Many to Many Relation Design - Intersection Table Design

后端 未结 11 1453
野的像风
野的像风 2020-12-07 19:20

I\'m wondering what a better design is for the intersection table for a many-to-many relationship.

The two approaches I am considering are:

CREATE TA         


        
11条回答
  •  失恋的感觉
    2020-12-07 19:51

    What you are building is called an "Intersection".

    I have a very clear memory of my database professor in school saying that an intersection relationship is nearly always an entity in its own right, and so it's normally worth allocating space for it as such. This would indicate that former is more "correct".

    That said, I personally tend to prefer the latter. It really comes down to whether you will ever retrieve one of these records directly or if you'll only use the table when joining on one of the original tables.

提交回复
热议问题