Your question is Top Content by Watch Time. 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+ Hotstar's Product Analytics team wants to identify the strongest-performing content in January 2026. Write a PostgreSQL query that ranks content within each content type using watch-time metrics.
content_type.| Column | Type | Description |
|---|---|---|
| content_idPK | INTEGER | Unique content identifier |
| title | VARCHAR(150) | Content title |
| content_type | VARCHAR(30) | Content category |
| Column | Type | Description |
|---|---|---|
| session_idPK | INTEGER | Unique viewing session identifier |
| content_id | INTEGER | Watched content identifier |
| watched_at | DATE | Date of the viewing session |
| watch_minutes | INTEGER | Minutes watched in the session |
| completion_pct | INTEGER | Percentage of content completed |