TASK #198 · MediumThe whole department headcount is counted instead of the needed part
Your brief
The report should show how many employees in each department have a manager.
It returns as many departments as the company has, but the numbers are too
high: they also count employees who have no manager.
For some employees the manager_id column holds nothing.
Output department_id and employees_with_manager (number of employees in the department who have a manager).
For some employees the manager_id column holds nothing.
Output department_id and employees_with_manager (number of employees in the department who have a manager).
Ctrl / ⌘ + ↵
Result
Write a query and run it to see the results.
Schema
departmentsid, nameemployeesid, name, department_id, manager_id, salary, hired_atcustomersid, name, registered_atordersid, customer_id, employee_id, amount, created_atloginsuser_id, logged_at