Write a SQL query to analyze a collections funnel by stage, calculating conversion rates and drop-off between steps.
Use all available funnel stages and stage events. Count each account once per stage, including stages with no matching events.
stage_name, entrants, previous_entrants, conversion_rate_pct, and dropoff_count| Column | Type | Description |
|---|---|---|
| stage_idPK | INT | Unique funnel stage identifier |
| stage_name | VARCHAR(100) | Name of the collections funnel stage |
| stage_order | INT | Sequential position of the stage |
| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique stage event identifier |
| account_id | VARCHAR(30) | Account associated with the event |
| stage_id | INT | Funnel stage reached by the account |
| entered_at | DATE | Date the account entered the stage |