首页 > 其他 > 详细

内置函数 和 select练习3

时间:2016-12-16 16:54:55      阅读:215      评论:0      收藏:0      [点我收藏+]

技术分享技术分享技术分享技术分享技术分享

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

select * from score where cno=‘3-105‘and degree > (select degree from score where sno = ‘109‘and cno=‘3-105‘);

技术分享

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

select * from score s where s.degree>(select degree from score s join course c on s.cno = c.cno where c.cno=‘3-105‘ and s.sno=‘109‘);

技术分享

 

22、查询和学号为108的同学同年出生的所有学生的SnoSnameSbirthday列。

select sno,sname,sbirthday from student where sbirthday = (select sbirthday from student where sno = ‘108‘);

技术分享

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

select degree from score s join course c on s.cno=c.cno join teacher t on c.tno=t.tno where t.tname=‘张旭‘;

技术分享

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

select * from score e join student t on e.sno = t.sno where sclass in(95031,95033)

技术分享

内置函数 和 select练习3

原文:http://www.cnblogs.com/dnf1612/p/6187294.html

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