Sample Table For Practice
Sample Table For Practice
i) To display Wno, Name, Gender from table Worker in descending order of Wno.
ii) To display the name of all Female workers from the table Workers.
iii) To display the Wno and name of those workers from the table worker who are born between ‘1987-01-01’ and
‘1991-12-01’.
iv) To count and display MALE workers who have joined after ‘1986-12-01’.
v) SELECT COUNT (*), DCODE FROM WORKER GROUP BY DCODE HAVING COUNT > 1;
vi) SELECT DISTINCT DEPARTMENT FROM DEPT;
vii) SELECT NAME, DEPARTMENT, CITY FROM WORKER W, DEPT D WHERE W. DCODE = D. DCODE AND WNO < 1003;
viii) SELECT MAX(DOJ), MIN(DOB) FROM WORKER;
2)
i) Display the mobile company, mobile Name and price in descending order of their manufacturing date
ii) List the details of mobile phones whose names start with ‘S’.
iii) Display the names of mobile suppliers and quantity of all mobiles except “MB003”
iv) Display the names of mobiles companies having price between 3000 – 5000.
v) SELECT M_ID, SUM(M_Qty) FROM MobileStock GROUP BY M_ID;
vi) SELECT MAX(M_MF_Date), MIN(M_MF_Date) FROM MobileMaster;
vii) SELECT M1.M_ID, M1.Name, M2_Qty, M2.M_Supplier FROM MobileMaster M1, MobileStock M2 WHERE
M1.M_ID=M2.M_ID AND M2_Qty>=300;
viii) SELECT AVG(M_Price) FROM MobileMaster;
4)
i) Display the details of the faculty members whose salary are greater than 12000.
ii) Display the details of courses that cost between 15000 – 50000 (including both values).
iii) Increase the fee for the “System Designing” course by 500.
iv) Display details of those course which are taught by “Sulekha” in descending order of course.
v) SELECT COUNT (DISTINCT F_ID) FROM courses;
vi) SELECT MIN (Salary) FROM Faculty, Courses WHERE Courses.F_ID = Faculty.F_ID;
vii) SELECT SUM (Fees) FROM courses WHERE F_ID=102;
viii) SELECT AVG(Fees) FROM Courses:
5)
i) Display all the details of those watches whose name with Time.
ii) Display the name and price of those watches, which have price range between 5000 – 15000.
iii) Display the total quantity in store of ‘Unisex’ type watches.
iv) Display the watch names and the quantity sold in the first quarter.
v) SELECT MAX (price), MIN (qty_store) FROM watches;
vi) SELECT quarter, SUM (qty_sold) FROM sale GROUP BY quarter;
vii) SELECT Watch_Name , price, type FROM Watches W, Sales S WHERE W.watchId = S.watchId
viii) SELECT watch_Name, qty_store, SUM (qty_sold), qty_store- SUM (qty_sold) ‘ Stock‘ FROM watches W , sales S
WHERE W.watchId = S.watchId GROUP BY S.watchId;
6)
i) Display the customer’s names and all corresponding names of cars hired by them.
ii) Display names of cars, make and capacity in descending order of their seating capacity.
iii) Display the highest charges at which a vehicle can be hired from Carden.
iv) Display the names of all silver-coloured cars.
v) SELECT MAX (charges), MIN (charges) FRPM carden;
vi) SELECT COUNT (DISTINCT Make) FROM carden;
vii) SELECT COUNT (carName) FROM carden;
7)
8)