select * from student where score >= all(select avg(score) from student group by gnum, cnum) order by gnum, cnum, num ;