Tell me about how you would generate summaries given timesheet data.
Write a SQL query that summarizes qualifying January 2025 timesheet records for active employees. Include employees with no qualifying records, and ignore rows where hours is NULL.
employee_id, employee_name, timesheet_count, total_hours, and billable_hours.submitted or approved; NULL hours are ignored.total_hours descending, then employee_id ascending.| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee display name |
| is_active | BOOLEAN | Whether the employee is currently active |
| Column | Type | Description |
|---|---|---|
| timesheet_idPK | INT | Unique timesheet record identifier |
| employee_id | INT | Employee who submitted the timesheet |
| work_date | DATE | Date on which the work occurred |
| hours | NUMERIC(8,2) | Hours recorded for the work date |
| is_billable | BOOLEAN | Whether the recorded hours are billable |
| status | VARCHAR(40) | Timesheet approval status |