How can we analyze active employees by department?
WHERE filters individual rows before grouping, reducing the dataset before GROUP BY executes.
Active-only headcount tracking, valid transaction summaries, active subscription counts.
SELECT department, COUNT(*) AS active_employees
FROM employees
WHERE status = 'Active'
GROUP BY department;Practice typing production-grade SQL code for WHERE Before GROUP BY.