I am stuck here working on a homework and this is what I have got.
Instruction is: Display department name, city and number of different jobs in each department. tables employees (has job_id and department_id), deptos (has location_id, department_id but no job ids), locations (has location_id and city) I need to include all cities even the ones without employees
What I was trying to do...
select d.department_name, l.city, count (distinct e.job_id)
from employees e
join deptos d on (e.department_id=d.department_id)
join locations l on (d.location_id=l.location_id)
group by d.department_name