Teradata Vantage reporting needs a monthly sales trend for active sales regions. Write a PostgreSQL-compatible SQL query that calculates monthly sales and a rolling three-month average for each active region from January through April 2025.
region_name, month_start, monthly_sales, and rolling_3_month_avg.region_name ascending, then month_start ascending.rolling_3_month_avg to two decimal places.0.00 when calculating the rolling average.| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique identifier for a sales region |
| region_name | VARCHAR(100) | Display name of the sales region |
| is_active | BOOLEAN | Whether the region is included in reporting |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| region_id | INT | Region associated with the transaction |
| sale_date | DATE | Date on which the sale occurred |
| amount | DECIMAL(12,2) | Sales amount, which may be NULL |