Exercise - 1 SQL Basics - DDL
Exercise - 1 SQL Basics - DDL
Exercise - 1 SQL Basics - DDL
S SE Semester : Summer I - 18
Database Management Systems
Course : Code : SWE304
Lab
Faculty : Prof. M. Premalatha Slot : L1+L4+L5+L8+L9+L11
Ex. No. 1
SQL Basics
Ex. No. 2
1. Constraints:
a. Add not null constraint to title in books table
b. Add unique constraint to email in authors table
c. Alter not null constraint in price attribute in books
table and set the check constraint so that value is
greater than 0.0
d. Drop not null constraint in books table - qty
attribute
e. Set a default value of qty in books table as 0
f. Drop any one foreign key constraint.
2. DML
a. List the authorid without repetition from book_authors
b. Update the email of an author
c. Insert records as given in the above tables
d. Increase the price of all books with 10% of its price
e. Sort the authors table in ascending order based on
their names
f. Sort the books table by price in descending and qty in ascending order.