SELECT dept_id, COUNT(*) FROM employees GROUP BY dept_id HAVING COUNT(*) > 2;
Write your query and click "Run Query" (Ctrl + Enter) to see results and testcase validation.