20,select name,age*10 十倍年龄 from student order by 十倍年龄;
//十倍年龄
使用统计函数
21,select count(*) from student;
//查询所有学生个数
22,select count(*) from student where age>25;
//查询学生年龄大于25的学生个数
23,select count(address) from student where age>25;
24,select count(DISTINCT address) from student where age>25;
//去重
25,select max(age) as 最大年龄,min(age) as 最小年龄 from student;
//最大年龄和最小年龄
26,select name,age,sex from student where age=(select max(age) from student);
//查询年龄最大的学生
27,select count(*) as 学生总数,sum(age) as 学生年龄之和 from student;
//学生总数以及学生年龄之和
Group by 子句
28,select address, count(*) as 人数 from student group by address;
//按照学生的住址信息进行分组
29,select address, count(*) as 个数, represent from student group by address, represent;
//每个地址对应的个数,以及地址对应的代表事物。
30,select address, COUNT(*) as 人数,represent from student group by rollup (address,represent);
31,select address, COUNT(*) as 人数,represent from student group by cube (address,represent);
having子句: