← SQL Operations Cases

Independent practice · SQLite

Identify visitors without checkout

My saved work →

Your work

Active 0:00 · Paused 0s

Show the reference answer
SELECT DISTINCT e.customer_id FROM events e WHERE e.stage='visit' AND NOT EXISTS(SELECT 1 FROM events c WHERE c.customer_id=e.customer_id AND c.stage='checkout')

Customers 2 and 4 visited but have no checkout event.