18. Write the SQL commands to answer the queries based on Fabric table
FabricID Fname Type Disc
F001 Shirt Woollen 10
F002 Suit cotton 20
F003 Tunic Cotton 10
F004 Jeans Denim 5
F006 Shorts Cotton 7
A)To insert the following record (“F005”, “Kurta”, “Wollen”,5)
b) To display only those fabric whose disc is more than 10
c) To display those record whose type is “Wollen”
d) To modify the fabric shirt by increasing discount of 10
e) To delete the record of fabric F003 from table
Answers
Answered by
36
Below are the SQL commands to answer the queries:
A) INSERT INTO Fabric table (FabricID, Fname, Type, Disc)
VALUES ('F005','Kurta', 'Wollen','5');
B) SELECT * FROM Fabric table
WHERE Disc > 10;
C) SELECT FabricID, Fname, Type, Disc
FROM Fabric table
WHERE Type = 'wollen';
D) UPDATE Fabric table
SET Disc = 20 WHERE Type ='shirt'; //increasing discount by 10
E) DELETE Fabric table
WHERE FabricID ='F003';
Similar questions