Kirk Ouimet
Kirk Ouimet

Reputation: 28374

Calculating Percentile Using Cumulative Data in MySQL

What should the percentile ranks be for each of these records and is there a MySQL query I can run to calculate the percentile for the score?

id    score   cumulative_score     percentile
1     100     100                  ?
2     50      150                  ?
3     25      175                  ?
4     25      200                  ?
5     10      210                  ?

Upvotes: 1

Views: 539

Answers (1)

WhirlWind
WhirlWind

Reputation: 14112

Generally, a percentile rank is the value of a variable below which a certain percentage of observations fall.

So, you don't specify if this is for "score" or "cumulative score," but for score, 80% of the observations fall below 100, 60% below 50, 20% below 25 and 0% below 10.

Upvotes: 1

Related Questions