A streaming platform wants to identify episodes that are experiencing...
A streaming platform wants to identify episodes that are experiencing significant 'viewership momentum' - episodes where the daily watch count has increased for at least 3 consecutive days, and by at least 20% each day compared to the previous day. For each such episode, calculate the total momentum period length (consecutive days of growth), the cumulative viewership during the momentum period, and the peak daily growth rate achieved. Only include episodes that had their momentum period end within the last 30 days from 2024-03-15.
Example 1
- ›Return episode_id, title, momentum_days, total_views, peak_growth_rate
- ›Only episodes with 3+ consecutive days of 20%+ growth
- ›Momentum period must end within 30 days of 2024-03-15
- ›Order by peak_growth_rate DESC, then episode_id ASC
Reference solution available after you attempt the question.
Ready to solve it?
Start a session on Mockbit #63. Write your SQL, run it against real data, and get graded on correctness, efficiency, query structure, and business understanding.
- #42A video streaming platform tracks user viewing sessionshard
- #62FitFlex gym chain tracks member gym attendance through entry card swipeshard
- #64A major investment bank needs to identify potentially fraudulent card...hard
- #41You're analyzing user engagement for a social media platformeasy
- #43A regional bank wants to analyze account activity by branch locationeasy