Problem
Suppose that a website contains two tables, the Customers
table and the Orders
table. Write a SQL query to find all customers who never order anything.
Table: Customers
.
1 |
|
Table: Orders
.
1 |
|
Using the above tables as example, return the following:
1 |
|
Explanation
- We can use the Customers table
LEFT JOIN
the Orders table, and match theirId
, and whereOrders.Id is NULL
.
Solution
1 |
|