Open Support Tickets
Which support tickets are currently open and waiting for resolution?
- Date analysis
- Filtering
- Sorting
Challenge brief
Understand the request
Support Operations needs a live queue of all unresolved tickets to assign to available support agents at the start of each shift.
List all open tickets showing ticket_id, user_id, product_id, and created_date.
Return
- ticket_id
- user_id
- product_id
- created_date
Constraints
- Return tickets whose status is 'Open'
- Show the oldest tickets first and resolve date ties 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 to Open status. ORDER BY created_date so the oldest unresolved tickets appear first — the support queue priority order.
Hint 2
SELECT ticket_id, user_id, product_id, created_date FROM support_tickets WHERE status = 'Open' ORDER BY created_date.
Hint 3
Build question 28 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, user_id, product_id, created_date FROM support_tickets WHERE status = 'Open' ORDER BY created_date, ticket_id;Why this works
5 of 12 tickets are Open. Teams (product_id=3) has 3 of the 5 open tickets — consistent with Q23 which identified Teams as the most problematic product. Ordering by created_date shows the oldest unresolved tickets first.
Success check
5 open tickets — oldest is ticket 2 (user 2, Office) from Mar 2; newest is ticket 11 (user 11, Teams) from Mar 20
Expected result
Use this output to verify values, aliases, ordering, and row count.
| ticket_id | user_id | product_id | created_date |
|---|---|---|---|
| 2 | 2 | 1 | 2024-03-02 |
| 4 | 4 | 3 | 2024-03-04 |
| 7 | 7 | 3 | 2024-03-10 |
| 9 | 9 | 1 | 2024-03-15 |
| 11 | 11 | 3 | 2024-03-20 |
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.