Write a SQL query using window functions to identify the top three customer accounts by SMS volume for each region over the last quarter at Twilio.
Use the provided account and SMS usage tables. The previous quarter is the completed calendar quarter before the current quarter. Include ties only according to the specified deterministic account ID tie-breaker.
region, account_id, account_name, sms_volume, and volume_rank.region, volume_rank, and account_id.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique Twilio customer account identifier |
| account_name | VARCHAR(100) | Customer account name |
| region | VARCHAR(30) | Customer account geographic region |
| Column | Type | Description |
|---|---|---|
| usage_idPK | INT | Unique SMS usage record identifier |
| account_id | INT | Customer account associated with the usage |
| sent_at | TIMESTAMP | Timestamp when the SMS usage occurred |
| sms_count | INT | Number of SMS messages represented by the record |