SQL Worksheet – Subqueries (HR Database)
Part A: Questions
Q1. Find the names of employees who earn more than the average salary of all employees.
Q2. List the employees who work in the same department as ‘David Austin’.
Q3. Find the employees whose salary is greater than the salary of ‘Susan Mavris’.
Q4. Display the job titles of employees who earn the minimum salary in the company.
Q5. List the departments that have at least one employee.
Q6. Find the employee(s) who earn the highest salary in each department.
Q7. List the employees whose salary is greater than the average salary of their department.
Q8. Find the department name where ‘Lex De Haan’ works.
Q9. Find employees who earn more than the highest-paid employee in department 50.
Q10. Find employees whose salary matches any salary of employees in department 90.
Q11. List all employees who earn less than the average salary of employees in department 80.
Q12. Find the employee(s) who joined the company before their manager.
Q13. Find the location (city) of the department where ‘Neena Kochhar’ works.
Q14. List the employees who have the same job as ‘Den Raphaely’.
Q15. Find employees who work in a department located in ‘Seattle’.