LIVE Course for free

Rated by 1 million+ students
Get app now
+1 vote
64.8k views
in Computer by (72.1k points)

Write SQL commands for the queries (i) to (iv) and output for (v) to (viii) based on the tables Watches’ and Sale given below.

1. TO DISPLAY ALL THE DETAILS OF THOSE WATCHES WHOSE NAME ENDS WITH ‘TIME’

2. TO DISPLAY WATCH’S NAME AND PRICE OF THOSE WATCHES WHICH HAVE PRICE RANGE IN BE-TWEEN 5000-15000.

3. TO DISPLAY TOTAL QUANTITY IN STORE OF UNISEX TYPE WATCHES.

4. TO DISPLAY WATCH NAME AND THEIR QUANTITY SOLD IN FIRST QUARTER;

5. SELECT MAX (PRICE), MIN(QTY_STORE) FROM WATCHES;

6. SELECT QUARTER, SUM(QTY SOLD) FROM SALE GROUP BY QUARTER;

7. SELECT WATCH_NAME, PRICE, TYPE FROM WATCHES W, SALE S WHERE W. 

WATCH1D!=S.WATCHID; (viii) SELECT WATCH_NAME, QTYSTORE, SUM 

(QTY_SOLD), QTY_STORESUM (QTYSOLD) “STOCK” FROM WATCHES W, 

SALE S WHERE W. WATCHID = S.WATCHID GROUP BY S.WATCHID;

1 Answer

0 votes
by (89.3k points)
selected by
 
Best answer

1. SELECT * FROM WATCHES WHERE WATCH_NAME LIKE ‘%TIME’ 

(Vi mark for SELECT query) (Vi mark for where clause)

2. SELECT WATCH_NAME, PRICE WATCH WHERE PRICE BETWEEN 5000 AND 15000; 

Vi mark for SELECT query) (Vz mark for where clause)

3. SELECT SUM (QTY STORE) FROM WATCHES WHERE TYPE LIKE ‘UNISEX’; 

(Vz mark for SELECT query) (Vi mark for where clause)

4. SELECT WATCHNAME, QTY SOLD FROM WATCHES W,SALE S WHERE W. 

WATCHED = S. WATCHED 

AND QUARTER = 1;

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

...