Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
881 B
3
Indexable
Never
(i)
SELECT * 
FROM TEACHER 
WHERE Department = 'ECE' AND 
      Name LIKE 'A%S' AND 
      Age > 25;
(ii)
SELECT Name 
FROM TEACHER 
WHERE Department = 'Computer' AND 
      Sex = 'Female' AND 
      Dateofjoin < '2022-12-31';
(iii)
SELECT * 
FROM TEACHER 
WHERE Salary != 50000 
ORDER BY Dateofjoin DESC;
(iv)

SELECT Name, Salary, Age 
FROM TEACHER 
WHERE Department = 'Computer' AND 
      Dateofjoin BETWEEN '2017-12-10' AND '2022-12-10' AND 
      Sex = 'Male';

(i)
SELECT * 
FROM Hospital 
WHERE Department = 'Medicine' AND 
      Age != 18;
(ii)
SELECT Name 
FROM Hospital 
WHERE Department = 'Neuro' AND 
      Sex = 'Male' AND 
      Name LIKE 'R%A';
(iii)
SELECT *, COUNT(*) OVER (ORDER BY Date_of_admissions) AS Admission_Order
FROM Hospital;
(iv)
SELECT Name, Age 
FROM Hospital 
WHERE Sex = 'Male' AND 
      Enrolled = 1;
Leave a Comment