22,299
社区成员




create table 选课表
(
学号 varchar(9) Foreign Key references 学生表(学号),
课程编号 Varchar(8) Foreign Key references 课程表(课程编号),
成绩 smallint
)
select distinct 学号 from 选课表 t
where not exists
( select 1 from 选课表 where 学号='200515122' and 课程编号 not in (select 课程编号 from 选课表 where 学号=t.学号))
select * from 选课表 t
where not exists
( select 1 from 选课表 where 学号='200515122' and 课程编号 not in (select 课程编号 from 选课表 where 学号=t.学号))