Your question is SQL Top Watch Time by Month. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Disney+ France wants to identify its most engaged viewers each month. Write a PostgreSQL query to find the top three users by total watch time for every calendar month.
users with watch_events using the user identifier.watch_seconds values as zero.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique Disney+ subscriber identifier |
| user_name | VARCHAR(100) | Subscriber display name |
| country_code | CHAR(2) | Subscriber country code |
| Column | Type | Description |
|---|---|---|
| event_idPK | INTEGER | Unique viewing event identifier |
| user_id | INTEGER | User associated with the viewing event |
| watched_at | TIMESTAMP | Viewing event start timestamp |
| watch_seconds | INTEGER | Number of seconds watched |