Write a SQL query to analyze transaction failures by day, channel, and failure reason, and identify the top drivers of errors at Airtel Payments Bank.
Use the provided transaction, channel, and failure-reason tables. Include failed transactions only and treat missing failure reasons or unknown channels explicitly.
Output
- One row per failure date, channel, and failure reason.
- Return
failure_date, channel, failure_reason, daily_failure_count, channel_reason_total, reason_rank, and is_top_driver.
- Rank reasons within each channel by total failures, mark the top two as drivers, and order by date, channel, and reason.