CSL-220: Database Management Systems Lab Semester BS (CS) – 4-A Name: FURQAN ZAKA UD DIN Enrolment: 02-134211-077 Lab 06: 1. Write a query to display TeacherName and HireDate for all teachers in the same department as ‘Dr. Rizwan’ 2. Write a query to display TeacherID, Name, Salary of all teachers who have the same job as TeacherID = 9 Department of Computer Sciences CSL-220: DBMS Lab Semester BSCS 4A LAB 06: SUBqueries CSL-220: Database Management Systems Lab Semester BS (CS) – 4-A Name: FURQAN ZAKA UD DIN Enrolment: 02-134211-077 3. Write a query to display the TeacherID and Name for all teachers who earn more than the average salary. Sort the result in descending order of salary. 4. Write a query to display TeacherID, Name and Job of all teachers who are earning more than Dr. Safdar Department of Computer Sciences CSL-220: DBMS Lab Semester BSCS 4A LAB 06: SUBqueries CSL-220: Database Management Systems Lab Semester BS (CS) – 4-A Name: FURQAN ZAKA UD DIN Enrolment: 02-134211-077 5. Display Teacher Name and Salary of all employees who report to ‘Dr. Safdar’ 6. Write a query to display Teacher Name and Job of all teachers who has program ID as TeacherID = 2 and Salary greater than TeacherID = 7 Department of Computer Sciences CSL-220: DBMS Lab Semester BSCS 4A LAB 06: SUBqueries CSL-220: Database Management Systems Lab Semester BS (CS) – 4-A Name: FURQAN ZAKA UD DIN Enrolment: 02-134211-077 7. Write a query to display TeacherID, TeacherName and ProgramID of all teachers who earn less than the minimum salary of teacherID = 2 8. Write a query to display TeacherID, TeacherName of all teachers whose salary is equivalent to minimum salary of their Job. Department of Computer Sciences CSL-220: DBMS Lab Semester BSCS 4A LAB 06: SUBqueries CSL-220: Database Management Systems Lab Semester BS (CS) – 4-A Name: FURQAN ZAKA UD DIN Enrolment: 02-134211-077 9. Write a query to display TeacherID, TeacherName, Job of all Teachers whose salary is greater than the average salary of all programs 10. Write a query to display teachers that earn higher than all “J. Assist Prof”. Sort the results on salary from Higher to lower Department of Computer Sciences CSL-220: DBMS Lab Semester BSCS 4A LAB 06: SUBqueries