SQL语句:学生表(学号,姓名,。。。),选课表(学号,课程号,成绩),写出没有选择课程号为"c101"的所
SQL语句:学生表(学号,姓名,。。。),选课表(学号,课程号,成绩),写出没有选择课程号为"c101"的所
日期:2021-06-15 23:08:53 人气:1
第一种:select a.学号,a.姓名 from 学生表 a where not exists (select b.* from 选课表 b where b.学号 =a .学号 and b.课程号='c101') ;
第二种:select a.学号,a.姓名 from 学生表 a where a.学号 not in (select b.学号 from 选课表 b where b.课程号='c101') ;
第二种:select a.学号,a.姓名 from 学生表 a where a.学号 not in (select b.学号 from 选课表 b where b.课程号='c101') ;