Your question is Running Totals SQL 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.
Resideo's Smart Home platform tracks customer purchases associated with its connected-home products. Write a PostgreSQL query that reports each customer's completed purchase total by date and the cumulative total through that date.
status = 'completed' and a non-null purchase_date.amount as zero.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| purchase_idPK | INT | Unique purchase identifier |
| customer_id | INT | Customer associated with the purchase |
| purchase_date | DATE | Date when the purchase was recorded |
| amount | NUMERIC(10,2) | Purchase amount |
| status | VARCHAR(20) | Purchase processing status |