Write a SQL query to analyze foreign exchange transaction volume by day, currency pair, and branch, and identify the top-performing branches over time at City National Bank of Florida.
Use completed transactions to calculate monthly branch performance and daily currency-pair activity. Transactions with a NULL notional amount must be ignored.
Output
- One row per qualifying branch, transaction date, and currency pair.
- Columns:
month_start, transaction_date, branch_name, currency_pair, transaction_count, daily_volume_usd, monthly_volume_usd, and monthly_branch_rank.
- Include branches ranked in the top two for their month, including ties. Order by month, date, branch, and currency pair.