select sid,sname from Student
where sid in(
select distinct sid from SC
where cid in(
select cid from SC
where sid ='0000000001'
)
);
Student表:
SC表:
Teacher表:
Course表:
select sid,sname from Student
where sid in(
select distinct sid from SC
where cid in(
select cid from SC
where sid ='0000000001'
)
);
Student表:
SC表:
Teacher表:
Course表: