聚合函数会涉及到的5个单词:数量count(),最大max(),最小min(),平均数avg(),求和sum()
SELECT count(*)'数据总条数' FROM student where pwd is not null;
SELECT max(age) '年龄最大' FROM student;
SELECT min(age) '年龄最小' FROM student;
SELECT avg(age) '平均年龄' FROM student;
SELECT sum(age) '年龄总和' FROM student;
#使用年龄综合计算一下平均数
SELECT sum(age)/(select count(*) '数据总条数' from student) '平均年龄' FROM student;