0
← Exercises/
Business Analytics•11 of 14
Business AnalyticsAdvancedPRO

E-Commerce Checkout Drop-off Funnel Analysis

Scenario

Growth engineers measure user drop-off across the 4 core steps of the e-commerce purchase funnel: Cart -> Shipping -> Payment -> Confirmation.

Task
Analyze funnel records in `funnel_events`. Calculate: 1. `step_cart`: Count of distinct `session_id` with `funnel_step = 'cart'` 2. `step_shipping`: Count of distinct `session_id` with `funnel_step = 'shipping'` 3. `step_payment`: Count of distinct `session_id` with `funnel_step = 'payment'` 4. `step_confirmed`: Count of distinct `session_id` with `funnel_step = 'confirmed'` 5. `overall_conversion_pct`: `ROUND(100.0 * step_confirmed / step_cart, 1)` Return in a single summary row.
Expected Output Format

Purchase funnel step counts and overall conversion percentage.

Input Tables & Sample Data0 tables
Loading database schema...
Need a hint?
query.sql|Local Sandbox
Loading SQL editor...
Click "Run" or press ⌘ + Enter to execute your query

About the “E-Commerce Checkout Drop-off Funnel Analysis” SQL Problem

Business Scenario

Growth engineers measure user drop-off across the 4 core steps of the e-commerce purchase funnel: Cart -> Shipping -> Payment -> Confirmation.

Expected Output & Criteria

Purchase funnel step counts and overall conversion percentage.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

This challenge executes directly against the following relational schema in your browser:

CREATE TABLE funnel_events (
        event_id INT PRIMARY KEY,
        session_id VARCHAR(20) NOT NULL,
        funnel_step VARCHAR(30) NOT NULL
      );

Target SQL Clauses & Operators

COUNTROUND

Want more Business Analytics practice?

Explore the full syllabus of 14 exercises, syntax guides, and interview pitfalls.

View Business Analytics Track→