SQL Programs
SQL Programs
(i). Display the Mobile company, Mobile name & price in descending order
(ii). List the details of mobile whose name starts with “S”.
(iii). Display the Mobile supplier & quantity of all mobiles except “MB003‟
: SELECT M_Supplier, M_Qty FROM MobileStock
(iv). To display the name of mobile company having price between 3000 &
5000.
MB004 450
MB003 400
MB003 300
MB003 200
: 2017-11-20 2010-08-21
: 5450
SQL-2
· QUERIES
· Display the Trainer Name, City & Salary in descending order of theirHiredate.
ORDER BY HIREDATE;
· To display the TNAME and CITY of Trainer who joined the Institute in
the month of December 2001
AND ‘2001-12-31’;
· To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and
COURSE of all those courses whose FEES is less than or equal to 10000.
GROUP BY CITY;
· SELECT TID, TNAME, FROM TRAINER WHERE CITY NOT IN(‘DELHI’, ‘MUMBAI’);
: 103 DEEPTI
106 MANIPRABHA
: 101
103
102
104
105
· SELECT TID, COUNT(*), MIN(FEES) FROM COURSE GROUP BY TID HAVING
COUNT(*)>1;
: 101 2 12000
:4 65000
SQL-3
(iv) To display details of those courses which are taught by ‘Sulekha’ in descending
order of courses.
:6000
:17500
SQL-4
· To display all the details of those watches whose name ends
with ‘Time’
: 25000 100
:1 15
2 30
· 45
· 15
: HighTime 100 25 75
LifeTime 150 40 110
FROM [Person].[Person]
OUTPUT: