count:
--count (distinct|all)
select count(1) as count from student;--效率最高
select count(*) as count from student;
select count(distinct score) from student;
语句1结果:11
avg
--avg (distinct|all) select avg(score) score from student; select avg(distinct score) from student; select classno,avg(score) score from student group by classno;
语句3输出结果:
max:
--max (distinct|all)
select max(score) from student;
select classno, max(score) score from student group by classno;
min:
--min (distinct|all)
select min(score) from student;
select classno, min(score) score from student group by classno;
stddev(standard deviation)标准差
--stddev
select stddev(score) from student;
select classno, stddev(score) score from student group by classno;
sum
--sum
select sum(score) from student;
select classno, sum(score) score from student group by classno;
median--中位数
--median
select median(score) from student;
select classno, median(score) score from student group by classno;