- count,计数
统计学生数据表中男性数量
select count(*) from students where gender=‘男’;
- max,查找最大值
查找学生表中的最大年龄
select max(age) from students;
- min,查找最小值
查找最小年龄值
select min(age) from students;
- sum,求和
学生的年龄总和
select sum(age) from students;
- avg,求平均值
计算年龄平均值
select avg(age) from students;
- round(xxx.xxx,n),四舍五入小数点后保留几位,n表示保留位数
学生平均年龄小数点保留一位
select round(avg(age),1) from students;
- group by,分组
- 按性别分组
select gender from students group by gender;- 分组并统计每个组的数量
select gender, count(*) from