Write a SQL query to measure branch performance by month at Byline Bank, joining transactions, customer satisfaction, and staffing tables to identify trends and outliers.
Calculate completed transaction volume, transaction counts, satisfaction, staffing, month-over-month change, and an outlier indicator for each branch-month. Preserve branch-months with transactions even when related satisfaction or staffing records are missing.
Output
- One row per branch and calendar month with transactions.
- Include
branch_id, month, total_transaction_amount, transaction_count, average_satisfaction, average_staffing, month_over_month_change, trend, and is_outlier.
- Sort by
branch_id, then month ascending.