Headcount by department
easy
For every dept_id value in employees, including the group with no department (NULL), return dept_id and the number of employees. Order by dept_id.
Tables Company
- departmentsid, name, city
- employeesid, name, dept_id, manager_id, title, salary, hire_date, commission
- projectsid, name, dept_id, budget, start_date
- assignmentsemployee_id, project_id, hours
Concepts
- group by
Run shows your result on the sample data. Submit also runs the query on 2 other sets of data, so it has to be right in general: with ties, missing values (NULL) and rows that have nothing to join to.
Query
CompanyCtrl or Cmd + Enter runs it
Nothing run yet
Press Run to see your result on the sample data and compare it with the expected output. Submit checks it on the other data too.