SQL Server many-to-many design recommendation
Posted
by Jean-Philippe Brabant
on Stack Overflow
See other posts from Stack Overflow
or by Jean-Philippe Brabant
Published on 2010-05-09T20:14:45Z
Indexed on
2010/05/09
20:18 UTC
Read the original article
Hit count: 231
I have a SQL Server database with two table : Users and Achievements. My users can have multiple achievements so it a many-to-many relation.
At school we learned to create an associative table for that sort of relation. That mean creating a table with a UserID and an AchivementID. But if I have 500 users and 50 achievements that could lead to 25 000 row.
As an alternative, I could add a binary field to my Users table. For example, if that field contained 10010 that would mean that this user unlocked the first and the fourth achievements.
Is their other way ? And which one should I use.
© Stack Overflow or respective owner