LIVE Course for free

Rated by 1 million+ students
Get app now
+3 votes
104k views
in Computer by (78.0k points)

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;

1 Answer

+3 votes
by (76.1k points)
selected by
 
Best 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

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...