Write SQL and Python, run instantly in your browser, and track your progress.
You are a Content Analyst at Disney+. The Product team wants to understand viewing patterns by comparing weekend vs weekday engagement. Classify each session by whether it occurred on a weekend (Saturday/Sunday) or weekday, then calculate average watch time for each.
| Column Name | Type |
|---|---|
| session_id | int64 |
| user_id | int64 |
| started_at | object |
| watch_seconds |
You are a Content Analyst at Disney+. The Product team wants to understand viewing patterns by comparing weekend vs weekday engagement. Classify each session by whether it occurred on a weekend (Saturday/Sunday) or weekday, then calculate average watch time for each.
| Column Name | Type |
|---|---|
| session_id | int64 |
| user_id | int64 |
| started_at | object |
| watch_seconds |
| int64 |
| int64 |
| status | object |
| status | object |
| session_id | user_id | started_at | watch_seconds | status |
|---|---|---|---|---|
| 1 | 1 | 2025-06-26T05:44:01 | 2700 | completed |
| 2 | 1 | 2025-04-04T23:41:32 | 678 | abandoned |
| session_id | user_id | started_at | watch_seconds | status |
|---|---|---|---|---|
| 1 | 1 | 2025-06-26T05:44:01 | 2700 | completed |
| 2 | 1 | 2025-04-04T23:41:32 | 678 | abandoned |
| day_type | avg_watch_seconds | session_count |
|---|---|---|
| weekday | 3264.42 | 355 |
| weekend | 3043.67 | 142 |
| day_type | avg_watch_seconds | session_count |
|---|---|---|
| weekday | 3264.42 | 355 |
| weekend | 3043.67 | 142 |
2 rows returned.
2 rows returned.
1. Data Selection:
2. DateTime Operations:
3. Output:
1. Data Selection:
2. DateTime Operations:
3. Output:
| 3 | 1 | 2024-12-04T15:21:55 | 2460 | completed |
| 3 | 1 | 2024-12-04T15:21:55 | 2460 | completed |
| 4 | 1 | 2025-02-15T10:35:42 | 3626 | abandoned |
| 4 | 1 | 2025-02-15T10:35:42 | 3626 | abandoned |
| 5 | 1 | 2025-06-15T03:24:01 | 293 | error |
| 5 | 1 | 2025-06-15T03:24:01 | 293 | error |
| 6 | 1 | 2025-07-17T05:48:36 | 5580 | completed |
| 6 | 1 | 2025-07-17T05:48:36 | 5580 | completed |