Write a SQL query to identify the top 5 branches or financial centers by monthly transaction volume, including month-over-month change and rank.
Use completed transactions only. Return results for every month represented in the transaction data, including branches with zero completed transactions when needed for ranking or comparison.
month, branch_id, branch_name, transaction_volume, mom_change_pct, and monthly_rank.NULL when no prior-month volume exists or the prior volume is zero.| Column | Type | Description |
|---|---|---|
| branch_idPK | INT | Unique branch identifier |
| branch_name | VARCHAR(100) | Branch or financial center name |
| region | VARCHAR(50) | Operating region |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| branch_id | INT | Branch processing the transaction |
| transaction_date | DATE | Transaction posting date |
| status | VARCHAR(20) | Transaction processing status |
| transaction_type | VARCHAR(30) | Type of financial transaction |