Write SQL and Python, run instantly in your browser, and track your progress.
You are a Customer Success Analyst at Netflix. The team needs to see each member's current subscription state for retention analysis. Your task is to provide the most recent active subscription per member with the start date and whether it auto-renews. Sort by the smallest member identifier; break ties by the smallest subscription identifier.
| Column Name | Type |
|---|---|
| subscription_id | INTEGER |
| user_id | INTEGER |
| plan_id | INTEGER |
| start_date |
You are a Customer Success Analyst at Netflix. The team needs to see each member's current subscription state for retention analysis. Your task is to provide the most recent active subscription per member with the start date and whether it auto-renews. Sort by the smallest member identifier; break ties by the smallest subscription identifier.
| Column Name | Type |
|---|---|
| subscription_id | INTEGER |
| user_id | INTEGER |
| plan_id | INTEGER |
| start_date |
| TEXT |
| TEXT |
| end_date | TEXT |
| end_date | TEXT |
| status | TEXT |
| status | TEXT |
| auto_renew | INTEGER |
| auto_renew | INTEGER |
| subscription_id | user_id | plan_id | start_date | end_date | status | auto_renew |
|---|---|---|---|---|---|---|
| 1 | 58 | 6 | 2025-07-26 | active | 1 | |
| 2 |
| subscription_id | user_id | plan_id | start_date | end_date | status | auto_renew |
|---|---|---|---|---|---|---|
| 1 | 58 | 6 | 2025-07-26 | active | 1 | |
| 2 |
| user_id | subscription_id | start_date | auto_renew | subscription_rank |
|---|---|---|---|---|
| 2 | 50 | 2025-03-18 | 1 | 1 |
| 3 | 30 | 2025-03-01 | 0 | 1 |
| 4 | 61 | 2025-06-20 | 0 | 1 |
| user_id | subscription_id | start_date | auto_renew | subscription_rank |
|---|---|---|---|---|
| 2 | 50 | 2025-03-18 | 1 | 1 |
| 3 | 30 | 2025-03-01 | 0 | 1 |
| 4 | 61 | 2025-06-20 | 0 | 1 |
Showing first 5 of 32 rows. Latest active subscription per user.
Showing first 5 of 32 rows. Latest active subscription per user.
| 41 |
| 41 |
| 11 |
| 11 |
| 2025-03-15 |
| 2025-03-15 |
| 2025-05-29 |
| 2025-05-29 |
| canceled |
| canceled |
| 0 |
| 0 |
| 3 | 44 | 10 | 2025-06-28 | 2025-08-04 | canceled | 0 |
| 3 | 44 | 10 | 2025-06-28 | 2025-08-04 | canceled | 0 |
| 4 | 2 | 2 | 2025-02-27 | 2025-07-25 | expired | 0 |
| 4 | 2 | 2 | 2025-02-27 | 2025-07-25 | expired | 0 |
| 5 | 55 | 3 | 2025-07-10 | active | 1 |
| 5 | 55 | 3 | 2025-07-10 | active | 1 |
| 6 | 48 | 2025-07-07 | 1 | 1 |
| 6 | 48 | 2025-07-07 | 1 | 1 |
| 10 | 63 | 2025-04-26 | 1 | 1 |
| 10 | 63 | 2025-04-26 | 1 | 1 |