I am creating an application with a game lobby and players, of which there can be a varying number. I was thinking of creating a table RaceDetails with having a column named Players with a list of User IDs. Is there a better way to do this?
Asked
Active
Viewed 30 times
0
-
**YES! That's a horribly bad practice!** In a relational database, if you need to store multiple things - you need a **relation** - e.g. a separate table to hold these values, using a foreign key reference to link those to the "main" entity in question – marc_s Jan 29 '22 at 19:02
-
It is always a bad idea to store any list in any single column *because it is a violation of first normal form*. You store lists in the multiple associated rows of a child table, never packed into a column of a single row. – RBarryYoung Jan 29 '22 at 21:28
-
1Does this answer your question? [Is storing a delimited list in a database column really that bad?](https://stackoverflow.com/questions/3653462/is-storing-a-delimited-list-in-a-database-column-really-that-bad) – philipxy Jan 29 '22 at 22:07
-
Thanks for the comments - so I should create a seaprate table that holds the relation of players in a game lobby? – s_jack_frost Jan 29 '22 at 23:18