求没选修1号课程的学生姓名:
select sname from student where not exists ( select * from sc where student.sno = sno and cno = '1' )
如果不用EXISTS谓词,也能完成查询:
select sname from student where sno not in ( select sno from sc where cno = '1' )
求没选修1号课程的学生姓名:
select sname from student where not exists ( select * from sc where student.sno = sno and cno = '1' )
如果不用EXISTS谓词,也能完成查询:
select sname from student where sno not in ( select sno from sc where cno = '1' )