Customers Who Never Placed an Order
Customers Who Never Placed an Order
EasySQL0% accepted
Given Customers and Orders tables, find all customers who never placed an order. Write at least two approaches: using LEFT JOIN and using NOT IN.
Approach
Find customers with no orders using LEFT JOIN, NOT IN, or NOT EXISTS.
Input
Customers: [(1,Joe),(2,Henry),(3,Sam)]; Orders: [(1,customerId=3),(2,customerId=1)]
Output
Henry (Id=2 has no orders)
More SQL problems
Browse all coding problems →Scenarios & Expected Answers
Sign in to continue
Create a free account to view answers and mark progress.
- Free forever — no credit card
- Theory Q&A with detailed answers
- Points, streaks & leaderboards