Sql group ranking

the structure of the table is as follows:

    id      id    
    student_id course_id score
    1          1         60
    1          2         50
    1          3         70
    2          1         20
    2          2         40
    ...
    ...

without considering that the total score is the same, how to query the number of people who are higher than the total score of student_id=10, that is, their own ranking?

Apr.04,2021

try this, okay?

-sharp table_name
SELECT COUNT(student_id) FROM table_name GROUP BY student_id HAVING SUM(score) > (SELECT SUM(score) FROM table_name WHERE student_id = 10); 

score:'''select score from table where student_id=10'''
:'''select count(1) as cnt from table where score>'{0}' '''.format(score)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ef7e-2c43f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ef7e-2c43f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?