Write SQL and Python, run instantly in your browser, and track your progress.
You are a Product Marketing Analyst at Netflix. The team wants to spotlight premium offerings by area for pricing strategy analysis. For each region, your task is to return the highest-priced active plan with its plan name, type, and price, including a rank. Consider only active plans. Sort by region alphabetically; within each region, highest price first and break ties by the smallest plan identifier.
| Column Name | Type |
|---|---|
| plan_id | INTEGER |
| plan_code | TEXT |
| plan_name | TEXT |
| plan_type |
You are a Product Marketing Analyst at Netflix. The team wants to spotlight premium offerings by area for pricing strategy analysis. For each region, your task is to return the highest-priced active plan with its plan name, type, and price, including a rank. Consider only active plans. Sort by region alphabetically; within each region, highest price first and break ties by the smallest plan identifier.
| Column Name | Type |
|---|---|
| plan_id | INTEGER |
| plan_code | TEXT |
| plan_name | TEXT |
| plan_type |
| TEXT |
| TEXT |
| region | TEXT |
| region | TEXT |
| currency | TEXT |
| currency | TEXT |
| monthly_price | REAL |
| monthly_price | REAL |
| max_screens | INTEGER |
| max_screens | INTEGER |
| quality | TEXT |
| quality | TEXT |
| is_active | INTEGER |
| is_active | INTEGER |
| plan_id | plan_code | plan_name | plan_type | region | currency | monthly_price | max_screens | quality | is_active |
|---|---|---|---|---|---|---|---|---|---|
| 1 | PLN00001 | Basic (SD) | basic | US |
| plan_id | plan_code | plan_name | plan_type | region | currency | monthly_price | max_screens | quality | is_active |
|---|---|---|---|---|---|---|---|---|---|
| 1 | PLN00001 | Basic (SD) | basic | US |
| region | plan_id | plan_name | plan_type | monthly_price | region_rank |
|---|---|---|---|---|---|
| APAC | 11 | Premium (UHD) | premium | 14.39 | 1 |
| EU | 7 | Premium (UHD) | premium | 19.79 | 1 |
| LATAM | 15 |
| region | plan_id | plan_name | plan_type | monthly_price | region_rank |
|---|---|---|---|---|---|
| APAC | 11 | Premium (UHD) | premium | 14.39 | 1 |
| EU | 7 | Premium (UHD) | premium | 19.79 | 1 |
| LATAM | 15 |
Showing first 5 of 5 rows. Top plan per region by monthly price.
Showing first 5 of 5 rows. Top plan per region by monthly price.
| USD |
| USD |
| 6.99 |
| 6.99 |
| 1 |
| 1 |
| sd |
| sd |
| 1 |
| 1 |
| 2 | PLN00002 | Standard (HD) | standard | US | USD | 12.99 | 2 | hd | 1 |
| 2 | PLN00002 | Standard (HD) | standard | US | USD | 12.99 | 2 | hd | 1 |
| 3 | PLN00003 | Premium (UHD) | premium | US | USD | 17.99 | 4 | uhd | 1 |
| 3 | PLN00003 | Premium (UHD) | premium | US | USD | 17.99 | 4 | uhd | 1 |
| 4 | PLN00004 | Ads (4K) | ads | US | USD | 9.99 | 4 | 4k | 1 |
| 4 | PLN00004 | Ads (4K) | ads | US | USD | 9.99 | 4 | 4k | 1 |
| 5 | PLN00005 | Basic (SD) | basic | EU | USD | 7.69 | 1 | sd | 1 |
| 5 | PLN00005 | Basic (SD) | basic | EU | USD | 7.69 | 1 | sd | 1 |
| Premium (UHD) |
| Premium (UHD) |
| premium |
| premium |
| 12.59 |
| 12.59 |
| 1 |
| 1 |
| NA | 19 | Premium (UHD) | premium | 17.99 | 1 |
| NA | 19 | Premium (UHD) | premium | 17.99 | 1 |
| US | 3 | Premium (UHD) | premium | 17.99 | 1 |
| US | 3 | Premium (UHD) | premium | 17.99 | 1 |