DBMS ( ASSIGNMENT-3 )
GIVE THEANSWER FOR ALL THE QUESTION IN GU
FORMATE (GU Pages, GU Index, GU File style)
1. Differentiate DDL, DML, and DCL with two examples each. Also
explain how they affect the database storage.
2. Create a table named CUSTOMER using at least five different data
types. Also include constraints such as PRIMARY KEY, UNIQUE, and
CHECK.
3. Write SQL commands to perform the following using ALTER
TABLE:
a) Add a new column EMAIL
b) Modify the size of the NAME column
c) Drop the AGE column
4. Explain the difference between DROP and DELETE, with proper
examples and their impact on data recovery.
5. Insert at least five records into a COURSE table (CID, CNAME,
DURATION, FEES). Use both single-row and multi-row insert
statements.
6. For a SALARY table, write queries to:
a) Update salary of employees earning less than 20000
b) Delete records of employees who have resigned
7. Explain with examples how the following constraints ensure
data integrity:
PRIMARY KEY, NOT NULL, UNIQUE, CHECK, DEFAULT, and
FOREIGN KEY.
8. Write SQL syntax to create an ORDERS table with constraints
such as PRIMARY KEY, NOT NULL, UNIQUE, and FOREIGN KEY
Include meaningful sample values.
9. What are Views? Create a view called HIGH_SALARY showing
employees earning above 50,000. Also write SQL to update data
through the view.
10. Create a STUDENT table Write SQL syntax to create a STUDENT table
with the following fields:
SID (integer, Primary Key)
NAME (varchar)
AGE (int)
COURSE (varchar)
CITY (var-char), FEES (decimal)
Apply NOT NULL constraints where needed.