用SQL查询语句,题目:查询选修了“张林”老师所授课程的学生学号及课程号。

2025-03-06 16:52:11
推荐回答(2个)
回答1:

select sno,cno from student,sc where teacher='张林' and student.sno=sc.sno;

回答2:

按给出的结构 course表中应该存放授课教师信息 而student与sc通过sno关联 sc与course通过cno关联
语句如下:
select a.sno,a.cno from sc a
left join course b
on a.cno=b.cno
where b.teacher='张林'