13. 查询平均分超过80分的学生的学号和平均分:
Select sno, avg(grade) as 平均成绩from sc group by sno having avg(*)>=80 比较: 求各学生的60分以上课程的平均分:
select sno, avg(grade) as 平均成绩 from sc where grade>=60 group by sno
14. 查询”信息系”(IS)中选修了5门课程以上的学生的学号:
select sno from sc where sno in (select sno from student where sdept='IS') group by sno having count(*)>=2
三. 集合查询
15. 查询数学系和信息系的学生的信息;
select * from student where sdept=’MA’ union select * from student where sdept='IS'
16. 查询选修了1号课程或2号课程的学生的学号:
select sno from sc where cno='1'
Union
select sno from sc where cno='2'
比较实验三之3.
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新人文社科{access数据库}查询典型语句(3)全文阅读和word下载服务。
相关推荐: