Loading the editor…
Find customers who never had a paid or shipped order.
Lifecycle marketing wants people who created an account but have not completed a purchase. Cancelled and pending checkouts do not count as completed.
Return name and email. A completed order has status paid or shipped. Keep customers with no completed order. Sort by name.
| id | name | city | country | created_at | |
|---|---|---|---|---|---|
| 1 | Alice Chen | alice@northwind.io | Berlin | Germany | 2023-01-12 |
| 2 | Ben Okonkwo | ben@okonkwo.co | Lagos | Nigeria | 2023-03-02 |
| 3 | Clara Singh | clara@singh.dev | London | United Kingdom | 2022-11-20 |
| id | name | category | price_cents | stock |
|---|---|---|---|---|
| 1 | Trail Bottle | Outdoors | 2400 | 120 |
| 2 | Desk Lamp | Home | 4250 | 40 |
| 3 | Noise-canceling Headphones | Electronics | 18900 | 15 |
| id | customer_id | status | ordered_at | shipped_at |
|---|---|---|---|---|
| 1 | 1 | paid | 2024-11-02 | 2024-11-04 |
| 2 | 1 | paid | 2024-12-14 | 2024-12-16 |
| 3 | 3 | shipped | 2025-01-09 | 2025-01-11 |
| id | order_id | product_id | quantity | unit_price_cents |
|---|---|---|---|---|
| 1 | 1 | 1 | 2 | 2400 |
| 2 | 1 | 4 | 1 | 1200 |
| 3 | 2 | 3 | 1 | 18900 |
| id | order_id | method | amount_cents | paid_at | status |
|---|---|---|---|---|---|
| 1 | 1 | card | 6000 | 2024-11-02 | succeeded |
| 2 | 2 | card | 18900 | 2024-12-14 | succeeded |
| 3 | 3 | paypal | 22000 | 2025-01-09 | succeeded |
Ctrl or Cmd + Enter runs the query. The database resets on every run.
Run the query to see rows from the sample database.
Next exercise: Engineering and sales roster