Everyone, with or without a department
medium
List every employee, with the name of their department or the text 'None' when they have no department: employee name, department, then salary. Order by employee 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
- left join
- coalesce
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.