Your question is Date-Driven Revenue Query. Start with the requirements and the two 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.
Microsoft Store analysts need to identify the highest-value customers from the most recently completed calendar quarter. Assume the query runs on August 29, 2026, so the target period is April 1 through June 30, 2026.
Write a PostgreSQL query to join customers with their orders and return the top three customers by total order revenue.
SUM.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer's name |
| segment | VARCHAR(30) | Customer segment |
| Column | Type | Description |
|---|---|---|
| order_idPK | INT | Unique order identifier |
| customer_id | INT | Customer associated with the order |
| order_date | DATE | Date the order was placed |
| amount | NUMERIC(12,2) | Revenue amount for the order |