Saved Bookmarks
| 1. |
Consider the following tables STORE and SUPPLIERS and answer (a) and (b) parts of this question:Table : STOREItemNoItemScodeQtyRateLastBuy2005Sharpener Classic2360831-Jun-092003Ball pen 0.2522502501-Feb-102002Gel pen Classic211501224-Feb-102006Gel Pen Premium212502011-Mar-092001Eraser small22220619-Jan-092004Eraser Big22110802-Dec-092009Ball pen 0.5211801803-Dec-09Table: SUPPLIERSScodeSname21Premium Stationers23Soft Plastics22Tetra 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. |
|
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; |
|