1.select class.classname,x.studentname,max(tscore) mscore
from (select student.classid,student.studentid,student.studentname,sum(score) tscore from score inner join student on score.studentid=student.studentid
group by student.classid,student.studentid,student.studentname) x
inner join class on x.classid=class.classid
group by class.classname,x.studentname
2.select student.studentname,class.classname,y.score,y.subject
from student inner join class on student.classid=class.classid
inner join
(select score.scoreid,score.studentid,score.subject,score.score from score inner join
(select scoreid,subject,max(score.score) mscore from score
group by scoreid,subject,mscore) x on score.scoreid=x.scoreid and score.score=x.mscore) y
on student.studentid=y.studentid
3.select student.studentname,class.classname,y.score,y.subject
from student inner join class on student.classid=class.classid
inner join
(select score.scoreid,score.studentid,score.subject,score.score from score inner join
(select scoreid,subject,min(score.score) mscore from score
group by scoreid,subject,mscore) x on score.scoreid=x.scoreid and score.score=x.mscore) y
on student.studentid=y.studentid