AnalystPath

Tickets Filed on Weekends vs Weekdays

SQLMediumMid level~15 min

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_idagent_idfiled_on
1102024-06-01
2102024-06-02
3112024-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

Related SQL questions