Closed Support Tickets
Which support tickets have been resolved and marked as Closed?
- Filtering
- Sorting
Challenge brief
Understand the request
Support Quality wants to verify resolution performance and needs a list of all tickets that have been successfully closed.
List all ticket_ids where status = 'Closed'.
Return
- ticket_id
Constraints
- Return tickets whose status is 'Closed'
- Order by ticket ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
support_tickets
ticket_idINTEGERuser_idINTEGERproduct_idINTEGERcreated_dateDATEstatusTEXT
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All ticket data is in support_tickets. Filter status to 'Closed'. No JOIN needed — just the ticket_id.
Hint 2
SELECT ticket_id FROM support_tickets WHERE status = 'Closed'.
Hint 3
Build question 8 from the required result grain: choose the driving table, add only the joins and filters needed for that grain, then apply aggregation and deterministic ordering.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT ticket_id FROM support_tickets WHERE status = 'Closed' ORDER BY ticket_id;Why this works
7 of 12 tickets are Closed. The remaining 5 (ticket_ids 2, 4, 7, 9, 11) are Open. status = 'Closed' is a simple equality filter — note the capital C.
Success check
7 closed tickets — ticket_ids 1, 3, 5, 6, 8, 10, 12
Expected result
Use this output to verify values, aliases, ordering, and row count.
| ticket_id |
|---|
| 1 |
| 3 |
| 5 |
| 6 |
| 8 |
| 10 |
| 12 |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Apple
Independent Apple-style product, retail, services, support, workforce, and device-usage SQL practice.
Google
Independent Google-style search, advertising, user-engagement, and video-product SQL practice.
Amazon
Independent Amazon-style e-commerce, warehouse, inventory, and customer analytics SQL practice.
Return to the complete interview preparation experience.