programming-examples/sql/SubqueriesHRDatabase/Write a query in SQL to display the first and last name, salary, and department ID for those employees who earn more than the minimum salary of a department which ID is 40.sql
2019-11-18 14:05:53 +01:00

9 lines
391 B
SQL

/*Write a query in SQL to display the first and last name, salary, and department ID for those employees who earn more than the minimum salary of a department which ID is 40.
*/
SELECT first_name, last_name, salary, department_id
FROM employees
WHERE salary > ANY
(SELECT salary
FROM employees
WHERE department_id = 40);