1.update 库.表 set 列=数据 where 列=数据; #修改数据 记得添加条件 不然整列都会被修改。
2.delete from 库.表 where 列=数据; #删除数据 不加条件 会清空整个表
3.truncate table 表; #清空整个表
4.select count(*) from 库.表; # 查看数据量
5.select 列,列 from 库.表; #查看列的数据
6.select 列 from 库.表 where 列=数据; #根据条件查询数据
7.select 列 from 库.表 limit 0,10; #按步长查询
8.select 列1 from 库.表 order by 列2; #通过列2数据的升序排列查看列1
9.select 列1 from 库.表 order by 列2 desc; #通过列2数据的降序排列查看列1
10.where接条件符号:= < > >= <= != <>
where接条件:or and like
= : 精确查询
< > >= <= != <> : 范围查询
like : 模糊查询
11.select max(列1) as 别名 from 库.表; #查看列1的最大值
12.select min(列1) as 别名 from 库.表; #查看列1的最小值
13.select count(列1) as 别名 from 库.表; #查看列1行的总和
14.select sum(列1) as 别名 from 库.表; #查看列1的总数
15.select avg(列1) as 别名 from 库.表; #查看列1的平均值