select t3.name from class t1
left join sc t2 on t1.id=t2.classid
left join student t3 on t2.studentid=t3.id
where t1.name='数学'
select s.name from stutent s,class c, sc.sc
where c.name ='数学',and studentid=s.id and classid=c.id
select name from student where id in (select t2.studentid from class t1,sc t2 where t1.id=t2.classid and t1.name='数学')
|