Page 2 - Home Assignment-DDL and DML commands
P. 2
Table: PRODUCTS
PID PNAME QTY PRICE COMPANY SUPCODE
(pri key) (not null) (range 10-500, (foreign key)
Default 100)
101 DIGITAL CAMERA 14X 120 12000 RENIX S01
102 DIGITAL PAD 11i 100 22000 DIGI POP S02
104 PEN DRIVE 32GB 500 1100 STOREKING S01
106 LED SCREEN 32 70 28000 DISPEXPERTS S02
105 CAR GPS SYSTEM 60 12000 MOVEON S03
Write SQL commands for the following:
a) To create database ABC
b) To create the above two tables, within the database ABC.
c) To insert first two records in each table.
d) To add a column COMPANY_CITY in the table products.
e) To increase the price of all the digital (DIGITAL word in PName) products by 1000.
f) To delete all the records from products for the supplier S03.
g) To increase the size of column COMPANY.
h) To delete all the records from Products.
i) To delete both the tables