Write a query to find the rolling 7-day average of messages sent per Twilio customer account, accounting for days with zero activity.
Use the provided customer account and message data for January 1 through January 10, 2024. Return every account for every date in that period, including accounts and dates with no messages.
account_id, activity_date, message_count, and rolling_7_day_averageaccount_id, then activity_date| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique Twilio customer account identifier |
| account_name | VARCHAR(100) | Customer account name |
| created_at | DATE | Date the account was created |
| Column | Type | Description |
|---|---|---|
| message_idPK | INT | Unique message identifier |
| account_id | INT | Customer account associated with the message |
| sent_at | TIMESTAMP | Timestamp when the message was sent |
| message_type | VARCHAR(30) | Message channel or type |