Write an SQL query or Python code to solve a data problem.
Using the provided customer, order, and order-item data, return the customers with the highest positive revenue from completed orders in each region. Customers without qualifying revenue should be excluded.
region, customer_name, total_revenue, and revenue_rank.region ascending, then customer_id ascending.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| region | VARCHAR(30) | Customer region |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer who placed the order |
| order_date | DATE | Date the order was created |
| status | VARCHAR(20) | Order lifecycle status |
| Column | Type | Description |
|---|---|---|
| item_idPK | INT | Unique order-item identifier |
| order_id | INT | Order containing the item |
| quantity | INT | Number of units purchased |
| unit_price | NUMERIC(10,2) | Price per unit |