GROUP BY groups rows that have the same values in specified columns and allows aggregate functions to be applied to each group.
GROUP BY
SELECT department, COUNT(*) FROM employees GROUP BY department;
This groups employees by department and counts how many are in each.