Write SQL and Python, run instantly in your browser, and track your progress.
You are a Content Analyst at Netflix. The Viewer Insights team needs to understand viewing patterns for users who complete their sessions. Merge playback session data with user information and calculate viewing metrics per user.
| Column Name | Type |
|---|---|
| user_id | int64 |
| object | |
| full_name | object |
| country | object |
You are a Content Analyst at Netflix. The Viewer Insights team needs to understand viewing patterns for users who complete their sessions. Merge playback session data with user information and calculate viewing metrics per user.
| Column Name | Type |
|---|---|
| user_id | int64 |
| object | |
| full_name | object |
| country | object |
| Column Name | Type |
|---|---|
| session_id | int64 |
| user_id | int64 |
| watch_seconds | int64 |
| quality | object |
| status | object |
| Column Name | Type |
|---|---|
| session_id | int64 |
| user_id | int64 |
| watch_seconds | int64 |
| quality | object |
| status | object |
| user_id | full_name | country | |
|---|---|---|---|
| 1 | andrewbrown@icloud.com | Andrew Brown | CA |
| 2 | anthony.dubois@mail.com | Anthony Dubois | US |
| 3 | david92@hotmail.com | David Wagner |
| user_id | full_name | country | |
|---|---|---|---|
| 1 | andrewbrown@icloud.com | Andrew Brown | CA |
| 2 | anthony.dubois@mail.com | Anthony Dubois | US |
| 3 | david92@hotmail.com | David Wagner |
| session_id | user_id | watch_seconds | quality | status |
|---|---|---|---|---|
| 1 | 1 | 2700 | hd | completed |
| 2 | 1 | 678 | 4k | abandoned |
| session_id | user_id | watch_seconds | quality | status |
|---|---|---|---|---|
| 1 | 1 | 2700 | hd | completed |
| 2 | 1 | 678 | 4k | abandoned |
| user_id | full_name | session_count | total_watch_hours | avg_session_minutes |
|---|---|---|---|---|
| 29 | Yoon-ah Suzuki | 11 | 17.02 | 92.80 |
| 32 | Sung-ho Patel | 10 | 14.23 | 85.40 |
| 35 | Min-jun Reddy | 9 | 13.38 | 89.20 |
| user_id | full_name | session_count | total_watch_hours | avg_session_minutes |
|---|---|---|---|---|
| 29 | Yoon-ah Suzuki | 11 | 17.02 | 92.80 |
| 32 | Sung-ho Patel | 10 | 14.23 | 85.40 |
| 35 | Min-jun Reddy | 9 | 13.38 | 89.20 |
Showing first 5 of 60 rows.
Showing first 5 of 60 rows.
1. Data Selection:
2. Join:
3. Aggregation:
4. Output:
1. Data Selection:
2. Join:
3. Aggregation:
4. Output:
| ES |
| ES |
| 3 |
| 3 |
| 1 |
| 1 |
| 2460 |
| 2460 |
| 4k |
| 4k |
| completed |
| completed |
| 4 | 1 | 3626 | uhd | abandoned |
| 4 | 1 | 3626 | uhd | abandoned |
| 5 | 1 | 293 | sd | error |
| 5 | 1 | 293 | sd | error |
| 20 | Anna Rossi | 10 | 13.22 | 79.30 |
| 20 | Anna Rossi | 10 | 13.22 | 79.30 |
| 40 | Sophie Wang | 10 | 12.57 | 75.40 |
| 40 | Sophie Wang | 10 | 12.57 | 75.40 |