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
2019-11-18 14:05:53 +01:00

8 lines
282 B
SQL

/*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
);