实验三 SQL 语言进行简单查询一、实验目的掌握简单数据查询操作。二、实验内容使用各种查询条件完成指定的查询操作三、实验步骤1、查询选修了课程的学生人数。select count (distinct sno)from sc;2、查询学生 202515004 选修课程的总学分数.select sum(credit)from sc,coursewhere sno='202515004’ and sc。cno=course。cno and grade〉=60;3、查所有有成绩的学生学号和课程号。select sno,cnofrom scwhere grade is not null;4、查询年龄在 20~23 岁(包括 20 岁和 23 岁)之间的学生的姓名、系别和年龄select sname,sagefrom studentwhere sage between 20 and 23;5、查询选修了 3 号课程的学生的学号及其成绩,查询结果按分数降序排列。select sno,gradefrom scwhere cno='3'order by grade desc;6、求哪些学生还没有被分配系?select sno,snamefrom studentwhere sdept is null;7、求 CS 系中所有男同学的学生姓名和年龄。select sname,sagefrom studentwhere ssex=’男' and sdept='cs’;8、我校开设的课程中哪些课程名以“数据”两个字开头?select cnamefrom coursewhere cname like'数据';9、求哪些学生的姓名中第 2 个字是“力”?select snamefrom studentwhere sname like'_力%';10、求哪些学生的成绩为优秀,求出该学生的学号及相应的课程号.select sno,cnofrom scwhere grade>=90;11、求既不是 CS 系,也不是 MA 系的学生中年龄不小于 20 的学生姓名。select snamefrom studentwhere sdept not in(’cs','ma') and sage〉=20;12、求 CS 系中男女学生的数量分别是多少?select ssex,count(*)from studentwhere sdept='cs'group by ssex;13、求各系中每个年龄段的学生总人数,要求结果中对系进行排序,同一个系的按年龄排序。即想得到右表所示的结果。14、查询各系的学生的人数并按人数从多到少排序select sdept,count(*)from studentgroup by sdeptorder by count(*) desc; 15、查询各系的男女生学生总数, 并按系别升序排列, 女生排在前select sdept,sage,count(*)from studentgroup by sdept,sageorder by sdept,sage;16、查询选修了 3 门课程已上的学生的学号和姓名select sno,snamefrom scgroup by snohaving count(*)〉3;17、查询每个学生所选课程的平均成绩, 最高分, 最低分和选...