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 |