1.select a.class,b.name,c.subject,c.result from class a,student b,
result c,(select subject,max(result) maxscore from result group by subject) d where a.cid=b.cid and b.sid=c.sid and c.subject=d.subject
and c.result=d.maxscore
2.select a.class,b.name,c.tresult from class,student,(select top 1 sum(result) tresult,sid from result group by sid order by tresult desc) c where a.cid=b.cid and b.sid=c.sid
3.select a.class,b.name,c.tresult from class,student,(select top 1 sum(result) tresult,sid from result group by sid order by tresult) c
where a.cid=b.cid and b.sid=c.sid
4.select top 1 a.class,sum(result) totalscore from class a inner join student b on a.cid=b.cid inner join c on b.sid=c.sid group by a.class order by totalscore desc
5.select top 1 a.class,c.subject,avg(result) avgscore from class a inner join student b on a.cid=b.cid inner join c on b.sid=c.sid group by a.class,c.subject order by avgscore desc
6.select top 1 a.class,c.subject,avg(result) avgscore from class a inner join student b on a.cid=b.cid inner join c on b.sid=c.sid group by a.class,c.subject order by avgscore