For each dept_name (all departments): headcount, avg_salary (0 decimals), active_projects (no end date) โ zeros where empty, avg NULL if no staff.
6 rows with columns dept_name, headcount, avg_salary, active_projects โ first 3 shown:
| # | ||||
|---|---|---|---|---|
| 1 | Engineering | 7 | 127143 | 2 |
| 2 | Sales | 4 | 85000 | 0 |
| 3 | Marketing | 3 | 75000 | 1 |
Run your code to see the output here.