I have the following tables :
DEPARTMENT department_id department_name manager_id location_id
EMPLOYEES employee_id first_name last_name email phone_number hire_date job_id salary commission_pct manager_id department_id
I want to count the number of employees working in each department.
I have used the following query :
SELECT department_name, count(*)
FROM departments d LEFT OUTER JOIN employees e
ON e.department_id = d.department_id
GROUP BY department_name;
But in the results the employee which has no employees does not show up in the results. I want the number of employees to show up as 0. How do I do that?