Possible Duplicate:
If I have two tables in SQL with a many-many relationship, do I need to create an additional table?
I need some help on how to set this model up as data tables.
So, in my app I have “Items” and they have meta data like category, description, tags etc.
Say the item is a CD.
Now, any user can choose to Relate any two Items and an Item can have an infinite number of relations.
As well, each relation has a rating (say from 1 – 100) and a description.
How would i set this up in a database?
You have 2 different “entities” or ideas (as well as their metadata):
Each item relationship has 2 items (FK relationships to items) and a rating.
The items (and their other metadata) I assume you understand, since you didn’t focus on it.