Free practice · Interactive SQL · medium

Practice

Replace missing close dates for display

Return ticket_id and closed_date, but display Open when closed_date is NULL. Name the result closed_status.

Practice database

US customer support database

Fictional customer and support-ticket data for text, date, and NULL practice.

Runs locally in your browser
Table relationships
support_tickets.customer_idcustomers.customer_id

customers

Customer profile fields used for account reporting.

6 rows

Grain One row per customer

  • customer_idTEXTPK
  • customer_nameTEXT
  • cityTEXT
  • state_codeTEXT
  • segmentTEXT
  • signup_dateTEXT
Preview source rows
customer_idcustomer_namecitystate_codesegmentsignup_date
C-101Northstar HealthAustinTXHealthcare2025-11-15
C-102Blue Ridge BooksRichmondVARetail2025-12-01
C-103Pacific Office WorksSan DiegoCAMidmarket2026-01-08

support_tickets

Customer support requests with intentionally untidy subjects.

5 rows

Grain One row per support ticket

  • ticket_idTEXTPK
  • customer_idTEXTFK
  • opened_dateTEXT
  • closed_dateTEXT
  • priorityTEXT
  • subjectTEXT
  • channelTEXT
  • resolution_hoursREAL
Preview source rows
ticket_idcustomer_idopened_dateclosed_dateprioritysubjectchannelresolution_hours
T-301C-1012026-02-252026-02-26Normal Billing issue email5
T-302C-1022026-03-02NULLHighLOGIN HELPwebNULL
T-303C-1032026-03-102026-03-12Normalshipping Delayphone18

SQL editor

Write one read-only query

SELECT and WITH only
Changes to this practice database are never saved.
Ready to check your work?Edit the starter query, run it, then compare your result with the task.