Jump to content

many to many


mgm_03

Recommended Posts

My application has many categories and subcategories with which I need to match with businesses.

 

After giving it alot of thought, I don\'t see how to avoid creating many tables, each being a map of many-to-many relationships.

 

From my understanding, many2many has disadvantages but I\'d like to know why. Can anyone enlighten me so I don\'t regret this strategy.

 

Using \"1 to many\" will require between 100 and 200 tables so, it doesn\'t appeat to be an elegant solution :?

Link to comment
Share on other sites

How do you implement one-to-one, one-to-many and many-to-many relationships while designing tables?

 

One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships.One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships.Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.

 

It will be a good idea to read up a database designing fundamentals text book.

Link to comment
Share on other sites

Thanks for trying to help me with this. I have read the books about database design and normalizing, etc. I understand it all but one book made a point to say that you should avoid making tables that have many2many relationships. I know how they\'re made and how to use them but before I implement it I just want to know if down the road, after insertions, updates, deletes, etc....will this approach turn out to be a nightmare....OR, should I force every table into a one-to-many structure.

 

sorry if I wasn\'t being clear on that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.