With CTEs, return each dept_name with headcount and projects (number of projects). Include all departments, using 0 where needed.
6 rows with columns dept_name, headcount, projects — first 3 shown:
| # | |||
|---|---|---|---|
| 1 | Engineering | 7 | 3 |
| 2 | Sales | 4 | 1 |
| 3 | Marketing | 3 | 2 |
Run your code to see the output here.