select sname from s
where not exist (select * from c
where not exist (select * from sc
where sc.sno = s.sno and sc.cno = c.cno));
where not exist (select * from c
where not exist (select * from sc
where sc.sno = s.sno and sc.cno = c.cno));
where not in(Select * from c
where not in(Select * from sc
where sc.sno=s.sno
and sc.cno=c.cno));
WHERE SNO IN (
SELECT A.SNO FROM
(SELECT SNO,COUNT(CNO) CNT FROM SC GROUP BY SNO) A,
(SELECT COUNT(CNO) CNT FROM C) B
WHERE A.CNT = B.CNT
)
where not exist (select * from sc where sc.sno = s.sno and sc.cno = c.cno))
不要使用in,运行时间会很长,而且效率很低
FROM s
WHERE
(SELECT COUNT(*) FROM C)
=
(SELECT COUNT(*) FROM SC WHERE sno = s.sno)