mysql查询95031班人数_数据库练习答案1

1、 查询Student表中的所有记录的Sname、Ssex和Class列。

2、 查询教师所有的单位即不重复的Depart列。

3、 查询Student表的所有记录。

4、 查询Score表中成绩在60到80之间的所有记录。

5、 查询Score表中成绩为85,86或88的记录。

6、 查询Student表中“95031”班或性别为“女”的同学记录。

7、 以Class降序查询Student表的所有记录。

8、 以Cno升序、Degree降序查询Score表的所有记录。

9、 查询“95031”班的学生人数。

10、查询Score表中的最高分的学生学号和课程号。

11、查询‘3-105’号课程的平均分。

12、查询Score表中至少有5名学生选修的并以3开头的课程的平均分数。

13、查询最低分大于70,最高分小于90的Sno列。

14、查询所有学生的Sname、Cno和Degree列。

15、查询所有学生的Sno、Cname和Degree列。

16、查询所有学生的Sname、Cname和Degree列。

17、查询“95033”班所选课程的平均分。

18、查询选修“3-105”课程的成绩高于“109”号同学成绩的所有同学的记录。

1、select sname,ssex,class from student

2、select distinct depart from teacher

3、select * from student

4、select * from score where degree between 60 and 80

5、select * from score where degree in (85,86,88)

6、select * from student where class='95031'or Ssex='女'

7、select * from student order by class desc

8、select * from score order by cno asc ,degree desc

9、select count(sno) from student where class='95031'

10、select * from score where degree=(select max(degree) from score)

11、select avg(degree) from score where cno='3-105'

12、select avg(DEGREE) from score where cno like '3%' GROUP BY cno HAVING count(cno) > 4

13、select sno from score GROUP BY sno HAVING min(DEGREE) > 70 and MAX(degree)

14、select x.sname,http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlo,y.degree from student x,score y where x.SNO = y.SNO

15、select x.Sno,http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlame,x.degree from score x,course y where http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlo=http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlo

16、select x.Sname,http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlame,z.degree from student x,course y,score z where x.Sno=z.Sno and http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlo=http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlo

17、select avg(y.DEGREE) from student x, score y WHERE x.SNO = y.SNO and x.CLASS = '95033' GROUP BY http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlO

18、select x.* from score x, score y where http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlO = '3-105' and x.DEGREE > y.DEGREE and http://www.doczj.com/doc/29dd7af3482fb4daa48d4b5d.htmlO = '3-105' and y.SNO = '109'

1、查询成绩高于学号为“109”、课程号为“3-105”的成绩的所有记录。

2、查询“张旭“教师任课的学生成绩

3、查询选修某课程的同学人数多于5人的教师姓名

4、查询95033班和95031班全体学生的记录

5、查询存在有85分以上成绩的课程Cno

6、查询出“计算机系“教师所教课程的成绩表

7、查询选修编号为“3-105“课程且成绩至少高于选修编号为“3-245”的同学的Cno、Sno和Degree,并按Degree从高到低次序排序

8、查询选修编号为“3-105”且成绩高于选修编号为“3-245”课程的同学的Cno、Sno和De

  • 4
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值