Your question is SQL Experience. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Do you have SQL experience?
Using the supplied tables, write a query that summarizes approved employee hours during the first quarter of 2025. Include departments even when they have no active employees or qualifying time entries.
department_name, approved_employee_count, total_approved_hours, and workload_status.total_approved_hours descending, then department_name ascending.| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Unique department identifier |
| department_name | VARCHAR(100) | Department name |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee name |
| department_id | INT | Assigned department identifier |
| is_active | BOOLEAN | Whether the employee is active |
| Column | Type | Description |
|---|---|---|
| timesheet_idPK | INT | Unique time entry identifier |
| employee_id | INT | Employee associated with the entry |
| work_date | DATE | Date worked |
| hours | DECIMAL(6,2) | Hours recorded |
| status | VARCHAR(20) | Approval status of the entry |