Consider the following table named "GARMENT"' Write command of SQL for (i) to (iv) and output for (v) to (vii).
Table : Garment
Gcode |
GName |
Size |
Colour |
Price |
111 |
Tshirt |
XL |
Red |
1400 |
112 |
Jeans |
L |
Blue |
1600 |
113 |
Skirt |
M |
Black |
1100 |
114 |
Ladies Jacket |
XL |
Blue |
4000 |
115 |
Trousers |
L |
Brown |
1500 |
116 |
Ladies Top |
L |
Pink |
1200 |
(i) To display names of those garments that are available 'XL' size.
(ii) To display codes and names of those garments that have their name starting with 'Ladies'.
(iii) To display garment names, codes and prices of those garments that have price in the range 1000.00 to 1500.00 (both 1000.00 and 1500.00 included).
(iv) To change the colour of garment with code as 116 to "Orange".
(v) SELECT COUNT(DISTINCT (SIZE)) FROM GARMENT;
(vi) SELECT AVG (PRICE) FROM GARMENT;
(vii) SELECT GNAME FROM GARMENT WHERE SIZE IN ('M', 'L') AND PRICE > 1500;