Write commands of SQL for
(i) To display the names of all the items whose name starts with “A”
(ii) To display ICODEs and INAMEs of all items, whose Brandname is Reliable or Coscore
(iii) To change the Brandname to “Fit Trend India” of the item, whose ICODE as “G101”.
(iv) Add a new row for new item in GYM with the details:
“G107”, “Vibro Exerciser”, 21000, “GTCFitness”
ICODE | INAME | PRICE | BRANDNAME |
G101 | Power Fit Exerciser | 20000 | Power Gymea |
G102 | Aquafit Hand Grip | 1800 | Reliable |
G103 | Cycle Bike | 14000 | Ecobike |
G104 | Protoner Extreame Gym | 30000 | Coscore |
G105 | Message Belt | 5000 | Message Expert |
G106 | Cross Trainer | 13000 | GTC Fitness |
Ans:
(i) SELECT * FROM GYM WHERE INAME LIKE “A%”;
(ii) SELECT ICODE, INAME FROM GYM WHERE BRANDNAME IN (“Reliable”, “Coscore”);
(iii) UPDATE GYM SET BRANDNAME = “Fit Trend India” WHERE ICODE = “G101”;
(iv) INSERT GYM VALUES(“G107”, “Vibro Exerciser”, 21000, “GTCFitness”);