You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5 lines
254 B
SQL

/*30. Write a query in SQL to display those departments where any manager is managing 4 or more employees.*/
SELECT DISTINCT department_id
FROM employees
GROUP BY department_id, manager_id
HAVING COUNT(employee_id) >=4;