理解SQL中的Exists
s(s#,sname,age,sex) sc(s#,c#,grade) c(c#,cname,teacher) select sname from s where not exists ( select * from c where not exists( select * from sc where sc.s#=s.s# and sc.c#=c.c#) ) exists是用来判断是否存在的,当exists(查询)中的查询存在结果时则返回真,否则返回假。not exists则相反。 exists做为where 条件时,是先对where 前的主查询询进行查询,然后用