ANDTeacher.Tname='张三'; 这里使用DISTINCT的原因是张三老师可能教的是多门课程,那么SC表查询出来的SID也有可能是多个,即会有重复结果 运行结果如下所示
查询学过「张三」老师授课的同学的信息select student.*from student, scwhere student.sid = sc.sidand sc.cid in (select cid from course, teacher where course.tid = teacher.tid and Tname = 张三)同时连接多张表select student.*from teacher ,course ,student, scwh