MySQL Forums
Forum List  »  InnoDB

Many to Many relationships and Cross Reference Tables
Posted by: Amit Varia
Date: August 10, 2008 10:55AM

I'm creating a database that will contain 5 tables (a, b, c, d, e) all with relationships to others:

a<->b, a<->c, a<->d, a<->e, b<->c, b<->d, b<->e, c<->d, c<->e, d<->e

Now I read about creating many to many relationships in SQL and I know need to create a cross reference table. But all the articles I read were just about creating one many to many relationship, so just a<->b.

Any advice on which is better:
1) Create one cross reference table with 5 columns to hold the ids of all tables.
2) Create 10 cross reference tables that hold the relationships for one column to another (a<->b, a<->c, a<->d, a<->e, b<->c, b<->d, b<->e, c<->d, c<->e, d<->e).



Edited 1 time(s). Last edit at 08/10/2008 10:56AM by Amit Varia.

Options: ReplyQuote


Subject
Views
Written By
Posted
Many to Many relationships and Cross Reference Tables
9075
August 10, 2008 10:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.