programming-examples/sql/SubqueriesHRDatabase/Write a query to display the employee id, employee name (first name and last name ) for all employees who earn more than the average salary.sql

8 lines
282 B
MySQL
Raw Permalink Normal View History

2019-11-18 14:05:53 +01:00
/*Write a query to display the employee id, employee name (first name and last name ) for all employees who earn more than the
average salary.*/
SELECT employee_id, first_name,last_name
FROM employees
WHERE salary >
( SELECT AVG(salary)
FROM employees
);