SQL Subquery Exercises: Identify all the employees who earn more than the average and who work in any of the IT departments
SQL SUBQUERY: Exercise-28 with Solution
Write a query to identify all the employees who earn more than the average and who work in any of the IT departments.
Sample table: employees
Sample table: departments
SELECT last_name FROM employees WHERE department_id IN (SELECT department_id FROM departments WHERE department_name LIKE 'IT%') AND salary > (SELECT avg(salary) FROM employees);
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?