12 lines
374 B
MySQL
12 lines
374 B
MySQL
|
/*Write a query to identify all the employees who earn more than the average and who work in any of the IT 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);
|