select count(*)from 学生表 where class_id in (select class_id from 班级表 where grade=3 and class_no=5) and sex='男' 学生表中如果没有class_id,那么判断不出某些人属于哪个班,没法写