Your question is Top Spending Clients Per Region. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
American Express Global Business Travel uses Neo reporting to compare corporate travel spend across regional portfolios. The reporting team needs the highest-spending clients for the most recently completed fiscal year.
Write a PostgreSQL query that returns the top three corporate clients by total travel spend within each region for fiscal year 2025, defined as July 1, 2024 through June 30, 2025.
| Column | Type | Description |
|---|---|---|
| region_idPK | INTEGER | Unique regional portfolio identifier |
| region_name | VARCHAR(50) | Name of the geographic region |
| Column | Type | Description |
|---|---|---|
| client_idPK | INTEGER | Unique corporate client identifier |
| client_name | VARCHAR(100) | Corporate client name |
| region_id | INTEGER | Assigned region identifier |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique travel transaction identifier |
| client_id | INTEGER | Corporate client associated with the transaction |
| transaction_date | DATE | Date on which the transaction occurred |
| amount | NUMERIC(12,2) | Travel spend amount in dollars |