SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Shows at #1 for Three Weeks

Unsolved

Netflix publishes a weekly Top 10 for TV shows. weekly_views has one row per title, region and week, where week_start is the Monday that starts the week. A show's weekly total is the sum of its views across all regions. Movies are ranked on a separate list and must be ignored. The #1 show of a week is the show with the highest weekly total; if two shows tie, both are #1. Write an SQL query that finds every run of at least 3 consecutive weeks in which the same show was #1. Return title_id, title_name, streak_start (the week_start of the first week in the run) and weeks_at_number_one (the length of the run). Order the results by streak_start ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
🏢 Netflix

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM titles
Full source dataset
4 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine