1.班级表结构及初始数据
2.学生表结构及初始化数据
3.执行sql及结构
select d.name,男,女 from(select a.cid,a.男,b.女 from (select cid,count(id) "男" from student where sex='1' group by cid) a,(select cid,count(id) "女" from student where sex='0' group by cid) b
where a.cid = b.cid) c,class d where c.cid = d.id