一、聚合函数练习 1、统计<学生信息表>,统计共有多少个学生 Select count (*) as 学生数量 from A_studentinfo 2、统计<学生信息表>,统计年龄大于 20 岁的学生有多少个 Select count(*) as 学生数量 from A_studentinfo where (2008-yearofbirth)>20 3、统计<学生信息表>,统计入学时间在 1980 年至 1982 年的学生人数 select count(*) as 学生数量 from A_studentinfo where enrollment between '1998-01-01' and '2003-12-30' 对比以下查询方式,看看有何不同,为什么? select count(*) as 学生数量 from A_studentinfo where enrollment between '1998' and '2003' 4、统计<学生选修信息表>,统计学号为"S001"的学生的平均成绩 Select avg(score) as 平均成绩 from A_studentcourse where sno='S001' 5、统计<学生选修信息表>,统计学号为"S001"的学生的总成绩 select sum(score) as 总成绩 from A_studentcourse where sno ='S001' 6、统计<学生选修信息表>,查询课程号为”C001”的课程的最高成绩 select max(score) as 最高成绩 from A_studentcourse where cno='C001' 7、统计<学生信息表>,查询所有学生中的最大年龄是多少 select 2008-min(yearofbirth) as 最大年龄 from A_studentinfo 二、单表查询练习 1、查询<学生信息表>,查询学生"张三"的全部基本信息 Select * from A_studentinfo w here sname='张三' 2、查询<学生信息表>,查询学生"张三"和”李四”的基本信息 Select * from A_studentinfo w here sname='张三' or sname='李四' 3、查询<学生信息表>,查询姓"张"学生的基本信息 Select * from A_studentinfo w here sname like '张%' 4、查询<学生信息表>,查询姓名中含有"四"字的学生的基本信息 Select * from A_studentinfo w here sname like '%四%' 5、查询<学生信息表>,查询姓名长度为三个字,姓“李”,且最后一个字是“强”的全部学生信息。 select * from A_studentinfo w here sname like '李_强' 6、查询<学生信息表>,查询姓"张"或者姓”李”的学生的基本信息。 Select * from A_studentinfo w here sname like '张%' or sname like '李%' 7、查询<学生信息表>,查询姓"张"并且"所属省份"是"北京"的学生信息 Select * from A_studentinfo w here...