programming-examples/sql/JoinHRDatabase/26. Write a query in SQL to display the department name and number of employees in each of the department.sql

5 lines
245 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*26. Write a query in SQL to display the department name and number of employees in each of the department.*/
SELECT department_name, COUNT(*)
FROM employees
NATURAL JOIN departments
GROUP BY department_name;