The DataAnnotation Store analytics team tracks completed sales across active store locations. They need a daily revenue report that also shows cumulative revenue within each region.
Write a PostgreSQL query that calculates daily sales and a running total for each region.
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| store_id | INT | Store associated with the sale |
| sale_date | DATE | Date when the sale occurred |
| amount | NUMERIC(10,2) | Monetary value of the sale |
| status | VARCHAR(20) | Sale processing status |
| Column | Type | Description |
|---|---|---|
| store_idPK | INT | Unique store identifier |
| store_name | VARCHAR(100) | Name of the store |
| region | VARCHAR(50) | Geographic sales region |
| is_active | BOOLEAN | Whether the store is active |