DDL &DML Practice SQL
DDL &DML Practice SQL
(1) Identify the required key constraints and create tables for the above mentioned schemas.
(2) Add a column named “PRICE” in BOOKDETAILS.
(3) Add a check constraint in GRADE column in ENROLL table to restrict that it can hold
only (O, A+, A, B+, B, RA).
(4) Drop the column ADDRESS in STUDENT table.
(5) What happens if the column ADDRESS in STUDENT table is dropped with “Cascade”
option?
(6) Create tables DEPARTMENT and BRANCH with the following schema
DEPARTMENT (DCODE, DNAME, DLOCATION, BRANCHCODE)
BRANCH (BRANCHCODE, BNAME)
(7) Add a foreign key constraint to the STUDENT table for linking it with DEPARTMENT
table. Give a name to your foreign key.
(8) Difference between DROP table and TRUNCATE table
(9) Add a NOT NULL constraint to the AUTHOR column in BOOKDETAILS table.
(1) Insert 10 records in each table without violating constraints using single row insert
(INSERT) and multiple row insert (INSERT ALL) command.
(2) Use substitution variable (&) in INSERT to read value for a variable.
(3) What is the difference between & and &&.
(4) Create a table called HIGHBOOK_PRICE with two columns (ISBN, Price). Insert the
records in the HIGHBOOK_PRICE table with the following details from BOOKDETAILS
table: “books whose price is greater than 3000”.
(5) Increase the price of all the books by 100, which were published after the year 2005.
(6) Delete all the first edition book details from the BOOKDETAILS table.
(7) Why we need of Commit Statement in DML commands?
(8) Modify the email id of a student whose roll number is specified by the user.