student表 1 查询全部: select * from table_name; 2 查询部分字段 :select 字段1,字段2,字段3 from table_name; 3 根据条件查询: select 字段名 from table_name where 条件表达式; 3.1 通过between and查询:select 字段名 from table_name where 字段名 (not) betwen 取值1 and 取值2; 3.2 通过and查询:select 字段名 from table_name where 表达式1 and 表达式2; 3.3 通过or查询:select 字段名 from table_name where 表达式1 or 表达式2; 3.4 通过in查询:select 字段名 from table_name where 字段 (not)in (元素1,元素2,元素3 …); 3.5 通过like查询:select 字段名 from table_name where 字段 like ‘字符串’; 3.6 空值查询:select 字段名 from table_name where 字段 is null; 4 分组查询:select 字段 from table_name group up 字段名 ; 5 having查询:select 字段 from table_name group up 字段名 having 表达式; 6 排序查询:select 字段 from table_name order by 字段(asc升序 desc 降序); 7 limit查询:select 字段 from table_name limit 显示条数(起始位置,条数); 8 消除重复查询:select 字段名,distinct(字段名) from table_name; 9 count查询:select 字段名 count(字段名) from table_name; 10 avg查询:select avg(字段名) from table_name; 11 sum查询:select sum(字段名) from table_name; 12 min max 查询:select max(min)(字段名) from table_name;