programming-examples/sql/SubqueriesHRDatabase/Write a query in SQL to display the full name (first and last name) of manager who is supervising 4 or more employees.sql
2019-11-18 14:05:53 +01:00

10 lines
409 B
SQL

/*Write a query in SQL to display the full name (first and last name) of manager who is supervising 4 or more employees.
*/
SELECT first_name || ' ' || last_name AS Manager_name,department_id
FROM employees
WHERE employee_id IN
(SELECT manager_id
FROM employees
GROUP BY manager_id
HAVING COUNT(*)>=4);