Ryan
Ryan

Reputation: 127

Leaderboard rankings / mass data organization in MySQL

I am creating a new website that will be a 'leaderboard' for a game. Each user will have columns in the database for a statistic (e.g. kills, deaths, points, etc).

I need to sort this data and give each user a global ranking for their statistic, which would be another column in the table.

I have no idea where to start with this - how would I organize the tables in an efficient manner?

Upvotes: 0

Views: 482

Answers (1)

YWE
YWE

Reputation: 2909

You could put each statistic in a table with userid (or whatever the unique id for a user is) as the primary key. But I wouldn't store the global ranking as a column. I would calculate it in the application.

Upvotes: 1

Related Questions