Skip to content

First response within one hour, by channel

MediumFull bankDates and timeRatios and percentagesNULL handling12 min2 hidden datasets

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:

  • channel
  • tickets: May tickets in the channel
  • met_sla: how many of them met the promise
  • pct_met: met_sla as a percentage of tickets, 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.

intUnique id.
textName.
textbilling, technical or general.
dateStart day.
tickets900 rows in the sample

One row per ticket. Key: ticket_id.

intUnique id.
intWho opened it.
intAssigned agent. NULL if never assigned.
textemail, chat or phone.
textlow, normal, high or urgent.
textbilling, bug, how_to or account.
timestampOpened (UTC).
timestampFirst reply from an agent. NULL if none yet.
timestampClosed as solved. NULL while open.
satisfaction366 rows in the sample

Survey answers, at most one per ticket. Key: ticket_id.

intThe ticket.
int1 (very unhappy) to 5 (very happy).
timestampWhen answered (UTC).

Related questions

Loading the editor and PostgreSQL