Write a SQL query to analyze Synthesia sales funnel performance by stage, including conversion rates and drop-off between stages.
Use the provided funnel stage definitions and stage history records. Calculate metrics across all defined stages, including stages with no recorded opportunities.
stage_order ascending.stage_name, stage_count, conversion_rate, and dropoff_rate.NULL when a rate cannot be calculated because the preceding stage has zero opportunities.| Column | Type | Description |
|---|---|---|
| stage_idPK | INT | Unique funnel stage identifier |
| stage_name | VARCHAR(50) | Name of the Synthesia sales funnel stage |
| stage_order | INT | Sequential position of the stage in the funnel |
| Column | Type | Description |
|---|---|---|
| history_idPK | INT | Unique stage history record identifier |
| opportunity_id | INT | Identifier of the sales opportunity |
| stage_id | INT | Funnel stage reached by the opportunity |
| entered_at | DATE | Date when the opportunity entered the stage |