SQL Fundamentals · SQL problem
Customers Who Never Ordered
A free sql problem from the SELECT, WHERE & JOIN skill. Read it here, then solve it in the app.
- Easy
- SQL problem
- Free
The problem
The marketing team wants to send a first-order discount to everyone who has signed up but never bought anything.
Return every customer who has no orders at all, with these columns:
| column | meaning |
|---|---|
id | the customer's id |
name | the customer's name |
Any order status counts as an order - a cancelled order still means the customer ordered. Rows may come back in any order.
Orders placed through guest checkout have no customer: their customer_id is NULL.
How it's graded
- Your SQL runs on PostgreSQL 18. Run compares your rows with the expected rows on the sample data; Submit runs it against hidden datasets built to catch the classic mistakes.
- Stuck? Hints come in four steps, from a nudge to a code skeleton, each costing part of the points.
More problems in SELECT, WHERE & JOIN
Write the query Customers Who Never Ordered free
No card needed. Lessons, practice questions and easy problems are free forever.
Free plan, no card · 7-day Pro trial · Cancel anytime