Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
42.8k views
in Computer by (69.4k points)
edited by

Consider the following tables STORE and SUPPLIERS and answer (a) and (b) parts of this question:

Table : STORE

ItemNo Item Scode Qty Rate LastBuy
2005 Sharpener Classic 23 60 8 31-Jun-09
2003 Ball pen 0.25 22 50 25 01-Feb-10
2002 Gel pen Classic 21 150 12 24-Feb-10
2006 Gel Pen Premium 21 250 20 11-Mar-09
2001 Eraser small 22 220 6 19-Jan-09
2004 Eraser Big 22 110 8 02-Dec-09
2009 Ball pen 0.5 21 180 18 03-Dec-09

Table: SUPPLIERS

Scode Sname
21 Premium Stationers
23 Soft Plastics
22 Tetra Supply

(a)  Write SQL commands for the following statements:

(i) To display details of all the items in the Store table in ascending order of LastBuy.

(ii)  To display ItemNo and Item name of those items from Store table, whose Rate is more than 15 Rupees.

(iii) To display the details of those items whose Supplier code (Scode) is 22 or Quantity in Store (Qty) is more than 110 from the table Store.

(iv)  To display Minimum Rate of items for each Supplier individually as per Scode from the table Store. 

1 Answer

+1 vote
by (61.3k points)
selected by
 
Best answer

(i)  SELECT * FROM STORE ORDER BY LastBuy;

(ii)  SELECT ItemNo, Item FROM STORE WHERE Rate >15;

(iii)  SELECT * FROM STORE WHERE Scode = 22 OR Qty >110;

(iv)  SELECT Scode, MIN(Rate) FROM STORE GROUP BY Scode;

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

...