Focus on coding with syntax not just logic; write the code in both SQL and Spark, and use a basic understanding of AWS services.
Use the supplied customer and order data to calculate each customer's completed 2025 revenue and position within their region. Provide the SQL solution and describe the equivalent Spark approach and an appropriate AWS execution option.
region, customer_id, customer_name, total_revenue, and revenue_rank| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| region | VARCHAR(50) | Customer's sales region |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| order_date | DATE | Order placement date |
| status | VARCHAR(20) | Order processing status |
| amount | NUMERIC(12,2) | Order revenue amount |