SQL Subquery Question Set (Employees Table)
Employees Table (Assumption)
Columns: employee_id, first_name, last_name, job_id, salary, department_id, manager_id,
hire_date
Easy Level (Basic Subqueries)
1. Find the employees who earn more than the average salary of all employees.
2. Display the employees whose salary is equal to the minimum salary in the company.
3. List the employees who were hired after the earliest hire date in the company.
4. Show employees working in the same department as 'Smith'.
5. Find the employee who earns the highest salary using a subquery.
Medium Level (Correlated Subqueries)
6. Display employees who earn more than the average salary of their department.
7. Find the employees who have the same job as 'John'.
8. List the employees whose salary is greater than the salary of their manager.
9. Find employees who joined before the manager of department 10.
10. Show employees who earn more than the lowest salary in department 30.
Hard Level (Nested & Complex Subqueries)
11. Find the second highest salary from the employees table using a subquery.
12. List the employees who earn the top 3 highest salaries.
13. Display employees whose salary is greater than the average salary of employees hired after
2010.
14. Find the employees who do not manage anyone (not present as a manager_id in employees
table).
15. Display the employees who belong to a department where the total salary is above the
company’s average department salary.