← Support SLA & Evidence Handoff My saved work →
Independent practice · SQLite
Find invalid reply timestamps
Practice dataset
Your work
Active 0:00 · Paused 0sKeep a handoff you can replay
Check your current answer, then download the output and its report. The report includes the source, answer and each check so you can review what passed and what needs work.
To replay your work, open this task with the same dataset, import your answer and check it again.
Show the reference answer
WITH cohort AS (SELECT t.*,p.limit_minutes,CASE WHEN t.first_reply_min<=1800 THEN t.first_reply_min ELSE NULL END AS observed_reply FROM tickets t JOIN policies p ON t.priority=p.priority WHERE t.opened_min>=0 AND t.opened_min<1440), checked AS (SELECT c.*,CASE WHEN observed_reply<opened_min THEN 'invalid_time' WHEN COALESCE(observed_reply,1800)-opened_min>limit_minutes THEN 'breached' WHEN observed_reply IS NOT NULL THEN 'met' ELSE 'awaiting' END AS sla_status,(SELECT MIN(e.evidence_id) FROM evidence e WHERE e.ticket_id=c.ticket_id AND e.kind='public_reply' AND e.recorded_min=c.observed_reply AND e.recorded_min>=c.opened_min AND e.recorded_min<=1800) AS evidence_id FROM cohort c) SELECT ticket_id FROM checked WHERE observed_reply<opened_min ORDER BY ticket_id
A negative duration is a data error, not a very fast response.