select s., b., bi.* fromborrowinfo bileft join student s on bi.student_id = s.idleft join book b on b.book_id = bi.book_idwhere bi.student_id in (select id from student where sex = '女');
多表查询采用 关联查询,类似如下:
使用连接查询,不推荐子查询