Write a SQL query to analyze operational performance by branch, joining transaction, customer, and exception tables to identify the highest-volume branches with the lowest error rates. Use all available rows and count a transaction with one or more exceptions as one errored transaction.
branch_name, total_transactions, exception_transactions, error_rate, volume_rank, and error_rate_rank.| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| customer_id | INT | Customer associated with the transaction |
| branch_name | VARCHAR(100) | Branch that processed the transaction |
| transaction_date | DATE | Date the transaction was processed |
| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| customer_name | VARCHAR(120) | Customer full name |
| customer_segment | VARCHAR(40) | Customer classification |
| Column | Type | Description |
|---|---|---|
| exception_idPK | INT | Unique exception identifier |
| transaction_id | INT | Transaction associated with the exception |
| exception_type | VARCHAR(80) | Operational exception category |
| resolved_at | DATE | Date the exception was resolved |