Your question is SQL for Last Quarter Purchases. 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.
Cisco Restaurant + Bar wants a quarterly customer purchase report for Business Analytics. Write a PostgreSQL query that summarizes customer activity during the last completed calendar quarter relative to the reporting date 2025-08-15.
customer_id ascending. Exclude purchases outside the quarter, including those on the quarter-end boundary.| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer’s full name |
| VARCHAR(255) | Customer email address |
| Column | Type | Description |
|---|---|---|
| purchase_idPK | INTEGER | Unique purchase identifier |
| customer_id | INTEGER | References customers.customer_id |
| purchased_at | TIMESTAMP | Timestamp when the purchase was made |
| amount | NUMERIC(10,2) | Purchase amount |