Write a SQL query to analyze weekly operational performance by team, including total volume, average turnaround time, and week-over-week change.
Use completed operational requests and calculate turnaround time from creation to completion. Include only weeks represented by completed requests, and calculate the percentage change in volume from the previous available week for each team.
team_name, week_start, total_volume, avg_turnaround_hours, and week_over_week_volume_change_pct.team_name, then week_start.NULL for the first available week of each team or when a percentage change cannot be calculated.| Column | Type | Description |
|---|---|---|
| team_idPK | INT | Unique team identifier |
| team_name | VARCHAR(100) | Operational team name |
| region | VARCHAR(50) | Team operating region |
| Column | Type | Description |
|---|---|---|
| request_idPK | INT | Unique operational request identifier |
| team_id | INT | Team assigned to the request |
| created_at | TIMESTAMP | Request creation timestamp |
| completed_at | TIMESTAMP | Request completion timestamp |
| status | VARCHAR(20) | Current request status |