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.customer_id, customer_name, purchase_count, total_spend, and last_purchase_date.customer_id, customer_name, purchase_count, total_spend, and last_purchase_date.purchase_count as zero and total_spend as 0.00 for customers without purchases.last_purchase_date as NULL when the customer has no purchase during the quarter.total_spend to two decimal places, displaying values such as 200.00 and 0.00.| 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 |