表:
course
score
student
teacher
代码段
SELECT student.SId AS 学号,student.Sname AS 姓名
FROM student
WHERE student.SId IN
(SELECT score.SId
FROM score
WHERE score.CId IN (01,02)
AND score.SId not IN
(SELECT score.SId
FROM score
WHERE score.CId NOT IN (01,02)
)
GROUP BY score.SId
HAVING COUNT(score.CId)=2
)