▸_sqlgym

65. Signup Funnel Conversion

MediumCTEsCTE chainingFunnelConversion rate

A funnel measures how many users progress through ordered stages. Chained CTEs make each stage a named, reusable step: count distinct users who visited, then those who added to cart, then those who purchased, and finally compute conversion rates between stages.

Three event tables share a user_id. A user is counted at a stage if they have at least one row in that stage's table.

Task: produce a one-row funnel summary: distinct visitors, cart users, purchasers, and the two conversion rates as percentages rounded to 1 decimal — visit→cart and cart→purchase.

Return columns visitors, carts, purchases, visit_to_cart_pct, cart_to_purchase_pct (one row).

Tables
Loading schema…
Expected outputrow order doesn't matter
Computing expected output…

This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases 5test cases in all. A sloppy query that only fits the example won't pass.

SQL
⌘/Ctrl+↵ run · ⇧⌘/Ctrl+↵ submit
Run a query to see its output here.