打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
SQL简单查询-2

12、查询“计算机系”与“电子工程系” 中不同职称的教师tname和prof

select tname,prof from teacher a where prof not in(select prof from teacher b where a.depart!=b.depart)

13、查询和学号为107的同学同年出生的所有学生的Sno、Sname和Sbirthday列

select sno,sname,sbirthday  from student where  year(sbirthday) =(select year(sbirthday) from student where sno='107')

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

select score.sno,score.cno,score.degree from teacher 

inner join course on teacher.tno = course.tno

inner join score on course.cno = score.cno

where teacher.depart = '计算机系'

或者:

select sno,Cno ,Degree from Score where Cno in (select Cno from Course where Tno in (select tno from Teacher where Depart='计算机系'))

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
经典SQL练习题
数据库
一套Oracle SQL练习题及答案
sql经典50题
第三题
5-3-4
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服