Write a SQL query to calculate the rolling 30-day sales volume for each product.
product_id exists in products. Sales with an unknown or NULL product_id are excluded.daily_sales_volume is the total quantity for a product on a sale_date. Negative quantities are returns and reduce the total. NULL quantities are ignored; if every quantity for that product and date is NULL, daily_sales_volume is NULL, but the row is still returned.rolling_30_day_sales_volume is the sum of the product's daily volumes over the current sale_date and the 29 calendar days before it. This is a calendar window, not the last 30 rows. NULL daily volumes are ignored; if every daily volume in the window is NULL, the result is NULL.product_id, product_name, sales_date (the sale_date value), daily_sales_volume, and rolling_30_day_sales_volume.product_id, then sales_date ascending.| Column | Type | Description |
|---|---|---|
| product_idPK | INT | Unique inventory product identifier |
| product_name | VARCHAR(100) | Product name |
| sku | VARCHAR(40) | Stock keeping unit |
| category | VARCHAR(60) | Product category |
| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique sales record identifier |
| product_id | INT | Referenced inventory product identifier |
| sale_date | DATE | Calendar date of the sale |
| quantity | INT | Units sold in the record |