How can we count employees in each department?
GROUP BY collapses rows with identical column values into summary rows.
Department headcounts, order counts by status, regional customer breakdowns.
SELECT department, COUNT(*) AS employee_count
FROM employees
GROUP BY department;Practice typing production-grade SQL code for GROUP BY.