select * from 学生表 a,教师表 b,教师学生关系表 c where a.studentid = c.studentid and b.teacherid = teacherid and b.teacherid = 你要查的老师id