Your question is Top 5 Shows Per Region. Start with the requirements and the three 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.
Prime Video's content analytics team wants to compare show engagement across viewer regions. Write a PostgreSQL query that identifies the top five shows in each region by total positive watch time.
watch_minutes for each region and show, ignoring null or non-positive values.show_id.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_code | VARCHAR(10) | Short region code |
| region_name | VARCHAR(100) | Display name of the region |
| Column | Type | Description |
|---|---|---|
| show_idPK | INT | Unique show identifier |
| show_title | VARCHAR(150) | Prime Video show title |
| genre | VARCHAR(50) | Show genre |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique viewing event identifier |
| region_id | INT | Referenced region |
| show_id | INT | Referenced show |
| watch_minutes | INT | Minutes watched during the event |