将user和grade_info连接,然后按照name分组汇总,用sum算每个人总积分。将结果按照总积分逆排序并限制为排第一的结果。

select u.name, sum(g.grade_num) as grade_sum
from user as u, grade_info as g
where g.user_id = u.id
group by u.name
order by grade_sum desc
limit 1