select name,population,area
from World
where area >=3000000 or population >=25000000;
1757. 可回收且低脂的产品 - 力扣(LeetCode)
select product_id
from Products
where (low_fats = 'Y') and (recyclable = 'Y');
select name
from customer
where referee_id !=2 OR referee_id is NULL;
183. 从不订购的客户 - 力扣(LeetCode)--左外连接
SELECT c.Name as Customers
from Customers c left join Orders o
on c.Id = o.CustomerId
where o.Id is NULL;
联表查询:
内链接
select 字段 from 表1 inner join 表2 on 连接条件