select sex,count(studentid) from student group by sexselect avg(grade) from student left outer join grade on student.studentid=grade.student_id