Given a table of Humana member transactions, write a SQL query using window functions to rank members by their total healthcare expenditure within each region.
Use the member_transactions table. Exclude rows with a NULL member_id or region. Treat NULL expenditure values as ignored by SUM.
member_id, region, total_healthcare_expenditure, and regional_rank.region, regional_rank, and member_id.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique healthcare transaction identifier |
| member_id | INT | Humana member identifier |
| region | VARCHAR(50) | Member service region |
| healthcare_expenditure | DECIMAL(12,2) | Amount associated with the transaction |