Write a SQL query to analyze onboarding drop-off by day and partner bank for Scalable Capital, using joins and aggregations to identify the largest funnel leaks.
Calculate the funnel from application start through identity verification, approval, and funding. Include applications whose partner bank or event records are missing.
Output
- One row per onboarding day and partner bank.
- Return
onboarding_day, partner_bank, stage counts, each sequential drop-off count, largest_leak_stage, and largest_leak_count.
- Sort by onboarding day ascending, then partner bank ascending. Break ties between leak stages in funnel order.