Write a SQL query to calculate weekly contact center performance by queue, including total calls, average handle time, and first contact resolution rate.
Use the calls and queues tables. Treat missing resolution values as not resolved, and label calls without a matching queue as Unknown.
week_start, queue_name, total_calls, average_handle_time_seconds, and first_contact_resolution_rate.week_start ascending and queue_name ascending.| Column | Type | Description |
|---|---|---|
| queue_idPK | INT | Unique queue identifier |
| queue_name | VARCHAR(100) | Contact center queue name |
| service_line | VARCHAR(100) | Operational service line for the queue |
| Column | Type | Description |
|---|---|---|
| call_idPK | INT | Unique call identifier |
| queue_id | INT | Queue handling the call |
| call_started_at | TIMESTAMP | Call start timestamp |
| handle_time_seconds | INT | Total handle time in seconds |
| first_contact_resolved | BOOLEAN | Whether the issue was resolved during the first contact |