Project 01 · Video Product Analytics
Understand viewer engagement.
Measure video-platform activity, viewing trends, retention and popular content.
The brief
- The business question
- Move from watch events to daily engagement, rolling trends, and signup-cohort retention.
- What you’ll deliver
- Daily activity metrics, rolling trends, viewer retention and top-performing videos.
- Skills
- Aggregation · Window functions · Retention
- Scope
- Advanced level · 4 milestones · 4 tables
Available data
Viewer signups and watch events. Repeated views are intentional; daily_metrics has missing days.
watch_events.viewer_id → viewers.idwatch_events.video_id → videos.idviewers
idintegerPKcountrytextsignup_attextreferred_byinteger
| # | id | country | signup_at | referred_by |
|---|---|---|---|---|
| 1 | 1 | US | 2025-01-01 | NULL |
| 2 | 2 | US | 2025-01-02 | 1 |
| 3 | 3 | GB | 2025-01-02 | 1 |
| 4 | 4 | IN | 2025-01-03 | 2 |
| 5 | 5 | GB | 2025-01-04 | NULL |
videos
idintegerPKcreator_idintegertitletextduration_secondsinteger
| # | id | creator_id | title | duration_seconds |
|---|---|---|---|---|
| 1 | 1 | 10 | SQL in ten minutes | 600 |
| 2 | 2 | 10 | Understanding joins | 900 |
| 3 | 3 | 11 | A day outdoors | 300 |
| 4 | 4 | 12 | Window functions | 720 |
| 5 | 5 | 12 | Build a project | 1200 |
watch_events
idintegerPKviewer_idintegervideo_idintegerwatched_attextwatch_secondsinteger
| # | id | viewer_id | video_id | watched_at | watch_seconds |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 2025-01-01 10:00:00 | 300 |
| 2 | 2 | 1 | 2 | 2025-01-01 11:00:00 | 450 |
| 3 | 3 | 2 | 1 | 2025-01-02 12:00:00 | 600 |
| 4 | 4 | 3 | 3 | 2025-01-02 13:00:00 | 120 |
| 5 | 5 | 1 | 4 | 2025-01-02 14:00:00 | 700 |
daily_metrics
daytextPKwatch_minutesinteger
| # | day | watch_minutes |
|---|---|---|
| 1 | 2025-01-01 | 30 |
| 2 | 2025-01-02 | 60 |
| 3 | 2025-01-04 | 90 |
| 4 | 2025-01-05 | 120 |
| 5 | 2025-01-07 | 60 |
Milestones
Start01
Daily active users & engagement
Measure daily activity and user engagement.
Not started
02Rolling averages & missing dates
Calculate rolling trends while accounting for missing dates.
Not started
03Cohorts & exact-day retention
Measure whether users return on a specific day after joining.
Not started
04Top N per group & ties
Find the leading records within each group and handle ties.
Not started