About the “Abandoned Cart Sessions & Lost GMV” SQL Problem
Business Scenario
Growth marketers want to run email retargeting sequences for high-intent shoppers who added items to their shopping cart but never completed checkout.
Expected Output & Criteria
High-value abandoned cart sessions with cart value >= $100.
Database Table Schema (PostgreSQL DDL)
PostgreSQL 16 WASMThis challenge executes directly against the following relational schema in your browser:
CREATE TABLE checkout_sessions (
session_id VARCHAR(20) PRIMARY KEY,
user_email VARCHAR(100) NOT NULL,
cart_total_usd NUMERIC(10, 2) NOT NULL,
cart_item_count INT NOT NULL
);
CREATE TABLE completed_purchases (
order_id INT PRIMARY KEY,
session_id VARCHAR(20) REFERENCES checkout_sessions(session_id),
paid_amount NUMERIC(10, 2) NOT NULL
);Target SQL Clauses & Operators
LEFT JOINIS NULLORDER BY
Want more Joins practice?
Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.