并/交/差
union all: 不去重(效率比union快很多)
在第一个集合不在第二个集合中
is null : 用于检查null
P is unknow == true: 当且仅当P是unknow
对于全部为null的集合,以上函数处了count,其他都返回null。
把某个列进行归类(类似HashMap)
在聚集函数出现时,除了聚集函数外全部col都需要出现在group by中
1select id, name, avg(num) from user group by id, name;Reason: group by 指定的col在结果集中类似HashMap中的key,不可重复
e.g. :
1234select distinct course_id from section where semester = 'Fail' and year = 2009 and course_id in (select course_id from section where semester = 'Spring' and year = 2010);$exists \; r \Leftrightarrow r \neq \varnothing$
类似
1len(list) not 0$X-Y=\varnothing \; \Leftrightarrow \; X \subseteq Y$
筛选集合中只出现一次的record