Dbms+Tutorial+Sheet 1
Dbms+Tutorial+Sheet 1
5) Solve the following on the given database S(Sno. Sname ,City, Status)] P(Pno, Pname,Color, Weight) SP(Sno,Pno,Qty) 6) Create the above tables by identifying appropriate primary keys and foreign keys. 7) Apply Column level constraints such that Qty such that it may be only Amritsar, Delhi, Batala and Qadian. 8) Apply Column level constraints such Qty should be between 100 to 1000, weight NOT NULL , Sname is NOT NULL and Pname is UNIQUE. 9) Insert five records in each table 10) Get supplier name where city is Amritsar. 11) Get Quantity Supplied by Ajay. 12) Get the supplier name and city that supply part P1. 13) Get color of parts supplied by S1. 14) Get color of parts supplied by Ajay. 15) Get supplier name who supply at least one red part. 16) Get part name where weight>100 and Sno=S1. 17) Get supplier name who supply part P1 with Quantity>100. 18) Get supplier name who supply pencils with Quantity>100. 19) Get supplier number who supplies maximum quantity. 20) Get supplier number who supply quantity greater than average Quantity. 21) Get supplier name that supply maximum quantity. 22) Get total number of Suppliers. 23) Get total number of parts supplied by supplier S1.
24) Count the parts having red color. 25) Count red parts supplied by Ajay. 26) Get the total quantity supplied by S1. 27). Get maximum quantity supplied by S1. 28) Get maximum quantity supplied by Rakesh. 29) Get total quantity supplied for each supplier. 30) Get total number of records supplied for each part. 31) Increase the Quantity of part P1 by 10 %. 32) Change the color of Red parts supplied by Ajay to Green. 33) Delete all the red parts supplied by supplier S1. 34) Delete all the entries of part P1. 35) Create view on table S that contains Sno and Sname of suppliers Amritsar. 36) Create a sequence that has minimum value 100 and maximum 1000. 37) Use the above sequence to store quantity information. 38) Alter the structure of table S to change the width of column Sname. 39) Alter the structure of table P to apply constraint NOT NULL on column color. 40) Drop view created above.