Stdxii - Sql-Questions
Stdxii - Sql-Questions
2. Consider the following tables Stationery and Consumer. Write SQL commands for the
statement (i) to (iv) and give output for SQL queries
(v) to (viii).
Table : STATIONERY
Table : CONSUMER
5. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to
(viii), which are based on the tables.
(i) Display the Trainer Name, City & Salary in descending order of their Hiredate.
(ii) To display the TNAME and CITY of Trainer who joined the Institute in the month of
December 2001.
(iii) To display TNAME, HIREDATE, CNAME, STARTDATE from tables TRAINER and
COURSE of all those courses whose FEES is less than or equal to 10000.
(iv) To display number of Trainers from each city.
(v) SELECT TID, TNAME FROM TRAINER WHERE CITY NOT IN(‘DELHI’, ‘MUMBAI’);
(vi) SELECT TNAME, CNAME, FEES FROM TRAINER, COURSE WHERE
TRAINER.TID=COURSE.TID AND FEES >10000;
(vii) SELECT TID, COUNT(*), MIN(FEES) FROM COURSE GROUP BY TID HAVING
COUNT(*)>1;
(viii) SELECT COUNT(*), SUM(FEES) FROM COURSE WHERE STARTDATE< ‘2018-09-15’;
********