Write SQL queries for (i) to (iv) and find the output for SQL query (V):
TRAINER
TID TNAME
CITY
HIREDATE SALARY
101
SUNAINA
MUMBAI
1998-10-15 90000
102 TANAMIKA DELHI
1994-12-24 80000
103 DEEPTI
CHANDIGARG 2001-12-21 82000
104 MEENAKSHI DELHI
2002-12-2578000
105 | RICHA
MUMBAI
1996-01-12 95000
106 I MANIPRABHA CHENNAI 2001-12-12 69000
(1) Display the Trainer Name, City & Salary in descending order of their
Hiredate.
(11) To display the Trainer Name and CITY of Trainer who joined the
Institute in the month of December 2001.
(I) To delete the record which has the ID as 102.
(iv) To increase the salary by 15%, where the Trainer's city is Delhi.
on SELECT TNAME,SALARY FROM TRAINER WHERE TID=101;
Answers
(i) SELECT TNAME, CITY, SALARY FROM TRAINER ORDER BY HIREDATE; (ii) SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE BETWEEN ‘2001-12-01’ AND ‘2001-12-31’;
OR
SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE >= ‘2001-12-01’ AND HIREDATE<=‘2001-12-31’;
OR
SELECT TNAME, CITY FROM TRAINER WHERE HIREDATE LIKE ‘2001-12%’; (iii) SELECT TNAME,HIREDATE,CNAME,STARTDATE FROM TRAINER, COURSE WHERE TRAINER.TID=COURSE.TID AND FEES<=10000; (iv) SELECT CITY, COUNT(*) FROM TRAINER GROUP BY CITY; (v) TID TNAME
103 DEEPTI
106 MANIPRABHA (vi) DISTINCT TID
101
103
102
104
105 (vii) TID COUNT(*) MIN(FEES)
101 2 12000 (viii)
COUNT(*) SUM(FEES)
4 65000
@OOOIRKIOOO
If HELPFUL the pls mark as BRAINLIEST