R
R
RemFex2020-01-18 18:38:18
SQL
RemFex, 2020-01-18 18:38:18

How can I create the following table in the database?

Co0hjZ3.png
We need to do something like a rating system: players can rate each other's profiles, and of course the ratings need to be stored somewhere. A table of this kind comes to mind (see picture), but I do not know how to do it correctly using databases. Or maybe there is another way to store such information?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail E, 2020-01-19
@Mikhail_E

I think the storage table should look like this (Columns):
"Player" - "PlayerWhich Traded" - "Score" (Score/Boolean).
Thus, the table will be compact, and if you need to extrapolate, this is already done when inferring from a specific data set.
Profit:
1. You don't have to store information about who the player has not rated.
2. If a new player appears, you will not have to change the structure of the table (Add a column with empty values ​​for everyone)
3. You will have a clear index (compact of 2 columns) to the table. (Not from columns = number of players).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question