Write a SQL window function query to compute a 7-day rolling average of payroll submission volume by business category at Gusto.
Use active business categories and evaluate the date range from January 1 through January 10, 2024. Include dates with no submissions, and calculate averages over the available dates at the beginning of the range.
category_name, submission_date, daily_submission_volume, and rolling_7_day_average.category_name, then submission_date.| Column | Type | Description |
|---|---|---|
| category_idPK | INT | Unique business category identifier |
| category_name | VARCHAR(100) | Business category name |
| is_active | BOOLEAN | Whether the category is currently active |
| Column | Type | Description |
|---|---|---|
| submission_idPK | INT | Unique payroll submission identifier |
| category_id | INT | Business category associated with the submission |
| submitted_at | TIMESTAMP | Timestamp when the payroll was submitted |