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_rankstatus equals completed.2025-01-01 and an exclusive upper bound of 2026-01-01.total_revenue as 0 when a customer has no qualifying revenue or the sum is NULL.total_revenue descending within each region.NULL regions last.| 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 |