Netflix wants to compare engagement across movie genres using viewing-session data. Write a PostgreSQL query that joins viewing sessions to title metadata and calculates the average watch time for qualifying sessions.
viewing_sessions to titles using title_id.| Column | Type | Description |
|---|---|---|
| title_idPK | INTEGER | Unique Netflix title identifier |
| title_name | VARCHAR(150) | Name of the title |
| genre | VARCHAR(50) | Primary title genre |
| content_type | VARCHAR(20) | Whether the title is a Movie or Series |
| Column | Type | Description |
|---|---|---|
| session_idPK | INTEGER | Unique viewing session identifier |
| title_id | INTEGER | References titles.title_id |
| profile_id | INTEGER | Netflix profile identifier |
| watched_at | DATE | Date of the viewing session |
| minutes_watched | NUMERIC(8,2) | Minutes watched during the session |
| session_status | VARCHAR(20) | Session completion status |