Tickets Filed on Weekends vs Weekdays
Problem
A support desk logs every ticket. Table `tickets` has `(ticket_id, agent_id, filed_on)` where `filed_on` is a date.
Report two numbers across the whole table: `weekend_count`, the number of tickets filed on a Saturday or Sunday, and `weekday_count`, the number filed Monday through Friday. The output is a single row with those two columns.
Tables
Example rows — the live problem includes the full dataset.
tickets
| ticket_id | agent_id | filed_on |
|---|---|---|
| 1 | 10 | 2024-06-01 |
| 2 | 10 | 2024-06-02 |
| 3 | 11 | 2024-06-03 |
Expected output
Your answer should return 1 row with the columns weekend_count, weekday_count.
Starter code (SQL)
SELECT *
FROM tickets;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock