First response within one hour, by channel
The task
The support desk promises a first reply within one hour. Measure how well each channel kept that promise for tickets created in May 2025 (from 2025-05-01 00:00:00 up to, not including, 2025-06-01 00:00:00).
A ticket meets the promise when first_response_at is at most 60 minutes after created_at. Exactly 60 minutes counts as met. A ticket with no first response yet has not met it, but it still counts as a ticket.
Return one row per channel that has May tickets:
channeltickets: May tickets in the channelmet_sla: how many of them met the promisepct_met:met_slaas a percentage oftickets, rounded to 1 decimal place
Sort by channel.
Expected output
channelticketsmet_slapct_met- Sorted by channel ascending.
- Numbers rounded to 1 decimal place.
- Checked on the sample and on 2 hidden datasets. How grading works
Tables Customer support desk · click a name to insert it
agents14 rows in the sample
Support agents. Key: agent_id.
| int | Unique id. | |
| text | Name. | |
| text | billing, technical or general. | |
| date | Start day. |
tickets900 rows in the sample
One row per ticket. Key: ticket_id.
| int | Unique id. | |
| int | Who opened it. | |
| int | Assigned agent. NULL if never assigned. | |
| text | email, chat or phone. | |
| text | low, normal, high or urgent. | |
| text | billing, bug, how_to or account. | |
| timestamp | Opened (UTC). | |
| timestamp | First reply from an agent. NULL if none yet. | |
| timestamp | Closed as solved. NULL while open. |
satisfaction366 rows in the sample
Survey answers, at most one per ticket. Key: ticket_id.
| int | The ticket. | |
| int | 1 (very unhappy) to 5 (very happy). | |
| timestamp | When answered (UTC). |
Related questions
Loading the editor and PostgreSQL
Loading the editor and PostgreSQL