CBSE Class 12 Informatics Practices
Question 13 of 79
MySQL SQL Revision Tour — Question 6
Back to all questions 6
Question Consider the following table named "GYM" with details about fitness items being sold in the store. Write command of SQL for (i) to (iv).
Table : GYM
| ICODE | INAME | PRICE | BRANDNAME |
|---|---|---|---|
| G101 | Power Fit Exerciser | 20000 | Power Gymea |
| G102 | Aquafit Hand Grip | 1800 | Reliable |
| G103 | Cycle Bike | 14000 | Ecobike |
| G104 | Protoner Extreme Gym | 30000 | Coscore |
| G105 | Message Belt | 5000 | Message Expert |
| G106 | Cross Trainer | 13000 | GTC Fitness |
(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"
(i)
SELECT INAME
FROM GYM
WHERE INAME LIKE 'A%';+-------------------+
| INAME |
+-------------------+
| Aquafit Hand Grip |
+-------------------+
(ii)
SELECT ICODE, INAME
FROM GYM
WHERE BRANDNAME = "Reliable" OR BRANDNAME = "Coscore";+-------+----------------------+
| ICODE | INAME |
+-------+----------------------+
| G102 | Aquafit Hand Grip |
| G104 | Protoner Extreme Gym |
+-------+----------------------+
(iii)
UPDATE GYM
SET BRANDNAME = 'Fit Trend India'
WHERE ICODE = 'G101';(iv)
INSERT INTO GYM
VALUES("G107", "Vibro exerciser", 21000, "GTCFitness");