American Express Global Business Travel wants to compare client spending within each operating region. Write a PostgreSQL query that calculates completed booking spend per client and ranks clients against others in the same region.
RANK() partitioned by region and ordered by total spend descending. Preserve ties with the same rank.| Column | Type | Description |
|---|---|---|
| client_idPK | INT | Unique client identifier |
| client_name | VARCHAR(120) | Client organization name |
| region | VARCHAR(40) | Client operating region |
| Column | Type | Description |
|---|---|---|
| booking_idPK | INT | Unique booking identifier |
| client_id | INT | Client associated with the booking |
| booking_status | VARCHAR(20) | Booking lifecycle status |
| booking_amount | DECIMAL(12,2) | Spend attributed to the booking |