2Xchampion
2Xchampion

Reputation: 656

My SQL workbench creating many to many relationship in EER diagram

so I was trying to create an EER diagram from a database model and I wanted to do something similar to this.

Say I have a table named Bag and another one named Address. I already set the PK in Address to be the FK in Bag, when creating the diagram I found that I cannot find the option "many to many" in mySQL workbench. see the screenshot I took

I wonder what is causing this to happen(maybe I'm doing something wrong but right now I cannot think of any reasonable explanation...)

Hopefully someone can shed some light on this.

Thanks!

Upvotes: 5

Views: 12543

Answers (2)

stackoverflow
stackoverflow

Reputation: 78

Many2Many relationship need an additional table to define the relationship between two tables. This table holds the FK to each of the two or more tables. If we want to get the data, just need to select columns by this relationship. Wish this would help you.

Upvotes: 0

ratiorick
ratiorick

Reputation: 736

Usually many to many relationship would have an additional table to create the relationship -

  • Address ( table holds addresses )

  • AddressBag ( tableholds the many to many the bags to addresses relationship with FK to address and FK to bags)

  • Bag ( table holds the bags )

Upvotes: 2

Related Questions