Chevron's analytics team wants to identify the highest-revenue users in each operating region. Write a PostgreSQL query that aggregates transaction revenue by user, ranks users within their region, and returns the top three users per region.
user_id.| Column | Type | Description |
|---|---|---|
| user_idPK | INTEGER | Unique user identifier |
| full_name | VARCHAR(100) | User's full name |
| region_name | VARCHAR(50) | Chevron operating region |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique transaction identifier |
| user_id | INTEGER | User associated with the transaction |
| revenue | NUMERIC(12,2) | Revenue attributed to the transaction |
| transaction_date | DATE | Transaction date |