https://leetcode.com/problems/rank-scores/


Runtime: 238 ms, faster than 93.55% of MySQL online submissions for Rank Scores.

Memory Usage: 0B, less than 100.00% of MySQL online submissions for Rank Scores.


```mysql
# I don't know how to solve this problem, so I did a check on Discuss
SELECT  score, 
(DENSE_RANK() OVER (ORDER BY score DESC)) AS 'rank' 
FROM Scores
# The core part is DENSE_RANK
# DENSE_RANK computes the rank of a row in an ordered group of rows and returns the rank as a NUMBER. 
# The largest rank value is the number of unique values returned by the query. So it won't count repeated numbers.

#+-------+------+
#| score | rank |
#+-------+------+
#| 4.00  | 1    |
#| 4.00  | 1    |
#| 3.85  | 2    |
#| 3.65  | 3    |
#| 3.65  | 3    |
#| 3.50  | 4    |
#+-------+------+
# The OVER here also have meanings. It will send a range of same score value to DENSE_RANK function for each row
# Like sending a window, or a list, for example, [1,1] at row1, [1,1] at row2, [2] at row3, [3,3] at row4
# This is a complex feature
```
