I'm trying to understand many-to-many relationships, but my head keeps breaking on this hobby project of mine:
In a database of games, I currently have a single table that holds all columns and values.
GAMES
id name alt_name1 alt_name2 type length group_size
----------------------------------------------------------------------------
1 foo foozoo NULL ice, team, silly s, m s, l, xl
However, when implementing search, I came across problems when looking specifically for a silly game with medium length for small groups.
As far as I understood, in order to normalize I would create a new table for name
(one id to up to three names). type
, length
and group_size
are many-to-many relationships, so I would need to create tables for their values and a table to hold their relation to the games:
type
games_type
length
games_length
group_size
games_group_size
Is there a better way than creating all of these tables?
Thanks for your thoughts!