1.

Consider the following table named "GARMENT"' Write command of SQL for (i) to (iv) and output for (v) to (vii).                            Table : GarmentGcodeGNameSizeColourPrice111TshirtXLRed1400112JeansLBlue1600113SkirtMBlack1100114Ladies JacketXLBlue4000115TrousersLBrown1500116Ladies TopLPink1200(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;

Answer»

(i) SELECT GName FROM Garment Where Size='XL'

(ii) SELECT Gcode, Gname FROM Garment- WHERE Name LIKE "Ladies%";

(ii) SELECT Gcode, Gname, Price FROM Garment WHERE Price BETWEEN 1000 and 1500;

(iv) UPDATE Garment SET Colour ='Orange' WHERE Gcode=116;

(v) 3

(vi) 1800

(vii) Jeans



Discussion

No Comment Found

Related InterviewSolutions