Hello,
You would use a desending sort and the LIMIT function to limit your output to the first 7 rows.
select student_id, grade
from grades
order by grades desc
limit 7
wrap that inside a query that goes through each student by id and you will have your results.