11 lines
388 B
MySQL
11 lines
388 B
MySQL
|
/*Write a query to display the employee number, name( first name and last name ) and job title for all employees whose salary
|
||
|
is more than any average salary of any department.
|
||
|
*/
|
||
|
|
||
|
SELECT employee_id, first_name, last_name, job_id
|
||
|
FROM employees
|
||
|
WHERE salary > ALL
|
||
|
( SELECT AVG(salary)
|
||
|
FROM employees
|
||
|
GROUP BY department_id
|
||
|
);
|