首页 > 数据库技术 > 详细

Oracle查询12题等

时间:2016-06-13 11:07:14      阅读:300      评论:0      收藏:0      [点我收藏+]

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

select cno,count(cno),avg(degree) from score t group by cno having count(cno)>=5 and substr(cno,0,1)=3

技术分享

13、查询分数大于70,小于90的Sno列。

select sno,degree from SCORE t where degree>70 and degree <90

技术分享

 

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

select sname,cno,degree from SCORE,student t 

技术分享

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

select sno,cname,degree from SCORE,course t 

技术分享

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

select sname,cname,degree from SCORE,course,student t 

技术分享

17、 查询“95033”班学生的平均分。

select class,cno,avg(degree) from score,student t  where class=95033 group by cno,class

技术分享

 

Oracle查询12题等

原文:http://www.cnblogs.com/miss123/p/5579548.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!