Netflix's playback pipeline sometimes delivers the same watch event more than once, and a later delivery may carry a corrected seconds_watched value. Rows that share an event_id describe the same viewing event, and only the row with the latest ingested_at should count (if ingested_at is tied, the higher row_id wins). Events can also arrive late, so ingested_at may be days after event_time. A late event still counts for the week in which it happened (event_time). Write an SQL query that returns the top 3 titles by total seconds watched for events whose event_time is on or after 2025-06-02 00:00:00 and before 2025-06-09 00:00:00. Return title_id and total_seconds. Break ties by the smaller title_id. Order the results by total_seconds descending, then title_id ascending.
Loading…
Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.
Ask questions, share alternate queries, and explore solutions
Your recent query executions and answer checks
This will insert the verified MySQL solution into your editor so you can study how each clause transforms the table.