A user *binged* a show if they watched at least 3 DIFFERENT episodes of that show within any 24-hour window (from one view's `viewed_at` up to and including exactly 24 hours later). Re-watching the same episode does not add to the count. Return distinct `user_id`, `show_name` pairs. Order by `user_id`, `show_name`.
| Column | Type |
|---|---|
| user_id | INTEGER |
| show_name | TEXT |
| episode_no | INTEGER |
| viewed_at | TIMESTAMP |
| user_id | show_name | episode_no | viewed_at |
|---|---|---|---|
| 1 | Dark Harbor | 1 | 2026-05-01 20:00:00 |
| 1 | Dark Harbor | 2 | 2026-05-01 21:00:00 |
| 1 | Dark Harbor | 3 | 2026-05-01 23:00:00 |
| 1 | Sky Rail | 1 | 2026-05-01 10:00:00 |
| 1 | Sky Rail | 2 | 2026-05-03 10:00:00 |
| 1 | Sky Rail | 3 | 2026-05-04 10:00:00 |
| 2 | Dark Harbor | 1 | 2026-05-02 10:00:00 |
| 2 | Dark Harbor | 1 | 2026-05-02 12:00:00 |
| user_id | show_name |
|---|---|
| 1 | Dark Harbor |
| 3 | Sky Rail |
Solve it in the live editor on this page — run on sample data, then submit against hidden tests.
‹ Watch Sessions with 30-Minute Timeout · Double-Booked Listings ›
{{ totalCount }} questions in the style asked at Amazon, Microsoft, Google, Meta, Flipkart and more — {{ hardPct }}% Hard. Write SQL in a real database engine in your browser, run it on sample data, then evaluate against hidden tests.
Company tags show where this type of question is commonly reported in interviews. Questions, data and solutions are written by TechTown.
{{ cur.statement }}
No submissions yet. Press Evaluate to submit your query.
{{ solutionSql }}
{{ out.error }}
You have solved your 3 free questions — nice work! Log in (free) to unlock all 150 questions, keep your streak and appear on the leaderboard.