Your question is Top 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.
Insight Global needs a quarterly billing report for client leadership. Assume the reporting date is July 15, 2025, so the last completed quarter is April 1 through June 30, 2025.
Write a PostgreSQL query to identify the top three highest-billing clients within each region.
invoices to clients and regions.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique region identifier |
| region_name | VARCHAR(50) | Display name of the region |
| Column | Type | Description |
|---|---|---|
| client_idPK | INT | Unique client identifier |
| client_name | VARCHAR(100) | Client organization name |
| region_id | INT | Region assigned to the client |
| Column | Type | Description |
|---|---|---|
| invoice_idPK | INT | Unique invoice identifier |
| client_id | INT | Client billed by the invoice |
| invoice_date | DATE | Date the invoice was issued |
| invoice_amount | NUMERIC(12,2) | Invoice amount in dollars |