Mercantile Bank wants to identify branches with the highest transaction failure rates over the most recent 30-day reporting period. Write a SQL query to calculate each branch's total transactions and failure percentage for that period.
branch_name, total_transactions, and failure_percentage.FAILED as failures. Transactions with other statuses, including NULL, count toward the total but not the failure count.2026-09-26; the 30-day period includes that date and the preceding 29 days.| Column | Type | Description |
|---|---|---|
| branch_idPK | INT | Unique Mercantile Bank branch identifier |
| branch_name | VARCHAR(100) | Mercantile Bank branch name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| branch_id | INT | Branch where the transaction was processed |
| transaction_date | DATE | Date the transaction was processed |
| status | VARCHAR(20) | Transaction outcome, such as SUCCESS or FAILED |