1.简单查询
2.聚合函数查询
3.子查询
4.内外连接
5.三大范式
6.事务
7.视图
8.索引
9.补充内容
简单查询
1.查询所有字段 查询需要查的字段
select * from where
2.取别名
3.条件查询
4.逻辑运算符 and / or / not
5.去重 distinct 按字段去重查询 from 表名
6.模糊查询 like %:任意个字符 _:有且仅有一个字符
7.between and 查询某个闭区间 [22,40]
查询年龄>=20 且 <=40的学生名字
select * from student where sage between 22 and 40
8.in 在什么里面 not in 不在里面
查找年龄在 18 19 21 22 的女生
select * from student where sage not in (18,19,21,22) and ssex = "女"
9.is null 查找某字段为空的数据
select * from student where ssex is null
select * from student where ssex is not null
select * from student where not ssex is null
10.分页查询
参数1 :从哪一条数据开始查 参数2 :需要查询的记录数
select * from student limit 0,5
11.排序查询
默认升序 :asc 降序 :desc
select * from student order by sage asc,sid desc
select * from student order by sage desc
复杂查询 / 聚合函数查询
求最值
select max(字段名) from stu
select min(字段名) from stu
总和:sum( )
统计