单表查询
sql
-- 584. is Null, !=
select name from Customer
where referee_id != 2 or referee_id is Null
-- 595. >=
select name, population, area
from World
where area >= 3000000 or population >=25000000
-- 1148. 去重 distinct author_id as id
select distinct author_id as id from Views
where author_id = viewer_id
order by author_id;
-- 1683. 函数 char_length 返回字符串长度
-- length 返回字节数, 对于ASCII之外的不适用
select tweet_id from tweets
where char_length(content) > 15
多表查询
sql
-- 1378. left join 将两个表的数据基于 id 列进行组合
select e.name, eu.unique_id from Employees as e
left join EmployeeUNI as eu
on eu.id = e.id
