Hi, the below should get you want you need based on your details.
If not, please follow the second link in my signature on how to post code and data so that we can help you get the solution your after.
SELECT
Class,
COUNT(ID) AS NumStudents,
SUM(Fees)
FROM
SomeTable
GROUP BY
Class