Many to Many Relationship

So I’m creating a database for the project flight now that the logical diagram is done. But I can’t seem to find a way to use “many to many” on the EER Diagram. If you look at my logical diagram I’m using a “many to many” relationship with the Airport and Flight diagram.

But I can’t seem to apply it on MySQL… There’s “1 to many”, “1 to 1”, but not “many to many”, or at least I can’t find it. I tried using n_m but all that does it create another table in between.

Please help.

The “table in between” is the way how you implement many-to-many relationships in relational databases. A foreign key column can only have a single value per row in relational databases so you need that table to physically model many-to-many relationships.

Note that you have a departure airport id and an arrival airport id in your logical model. If you don’t need layovers / vias you can physically implement that with two one-to-many relationships.

2 Likes