码迷,mamicode.com
首页 > 数据库 > 详细

Oracle查询12题等

时间:2016-06-13 11:09:23      阅读:297      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!