AArete analysts need a smoothed view of regional sales performance. Write a PostgreSQL query that calculates a rolling average of daily completed sales for each region.
sales to stores to obtain the region.| Column | Type | Description |
|---|---|---|
| store_idPK | INT | Unique store identifier |
| store_name | VARCHAR(100) | Store name |
| region | VARCHAR(50) | Operating region |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sale identifier |
| store_id | INT | Store associated with the sale |
| sale_date | DATE | Date on which the sale occurred |
| amount | DECIMAL(10,2) | Sale amount, possibly NULL |
| status | VARCHAR(20) | Transaction status |