题目描述:
SQL架构
某网站包含两个表,Customers 表和 Orders 表。编写一个 SQL 查询,找出所有从不订购任何东西的客户。
Customers 表:
Orders 表:
例如给定上述表格,你的查询应返回:
方法1:使用not in
主要思路:
# Write your MySQL query statement below
select name as customers
from customers
where id not in (select customerid from orders);