Given this dataset of partner transactions, write a query to identify the top three regions with the highest cancellation rates over the last quarter.
Use the previous calendar quarter relative to the query execution date. A cancellation rate is canceled transactions divided by all transactions in the region during that quarter.
region_name, transaction_count, cancelled_transaction_count, and cancellation_rate_percent| Column | Type | Description |
|---|---|---|
| region_idPK | INT | Unique identifier for a region |
| region_name | VARCHAR(100) | Display name of the region |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique identifier for a partner transaction |
| region_id | INT | Region associated with the transaction |
| transaction_date | DATE | Date on which the transaction was recorded |
| status | VARCHAR(20) | Transaction status, such as confirmed or cancelled |