Synchrony needs a workforce report for departments supporting products such as Synchrony Care. Write a PostgreSQL query that counts active employees by department.
is_active value is TRUE.department_name and active_employee_count, ordered alphabetically by department name.Place the active-employee condition in the join so that departments with no matching active employees remain in the result. Employees without a valid department should not create an additional department row.
| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Primary key for the department |
| department_name | VARCHAR(100) | Department name |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Primary key for the employee |
| employee_name | VARCHAR(100) | Employee's name |
| department_id | INT | Assigned department identifier |
| is_active | BOOLEAN | Whether the employee is currently active |