Write a SQL query to find the top 5 users by total spend in each region.
Treat users without transactions as having zero spend. Include each user at most once, and use user_id as the tie-breaker when total spending is equal.
region, user_id, user_name, and total_spendregion, descending total_spend, then ascending user_id| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User display name |
| region | VARCHAR(50) | User's geographic region |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| amount | NUMERIC(12,2) | Transaction amount |