Given a table of daily user balances, write a query to calculate the 7-day rolling average balance for every user at Current (NY).
Assume each row represents a user's balance on a calendar date. The seven-day period includes the current date and six preceding calendar days; missing dates are excluded, and NULL balances are ignored.
user_id, balance_date, and rolling_avg_balance.user_id, then balance_date ascending.| Column | Type | Description |
|---|---|---|
| balance_idPK | INT | Unique balance record identifier |
| user_id | INT | Current user identifier |
| balance_date | DATE | Date represented by the balance |
| balance | DECIMAL(12,2) | User balance on the recorded date |