Plaid wants to monitor transaction activity for users connected through Plaid Transactions. Write a PostgreSQL query that calculates a calendar-aware rolling 7-day average of daily transaction counts for each active user.
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Plaid user identifier |
| user_name | VARCHAR(100) | User display name |
| account_status | VARCHAR(20) | User account status |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| transaction_date | DATE | Transaction posting date |
| merchant_name | VARCHAR(100) | Merchant associated with the transaction |
| amount | NUMERIC(10,2) | Transaction amount |