Many to Many Relation Design - Intersection Table Design

后端 未结 11 1476
野的像风
野的像风 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:56

    The second is better. It constrains the junction box (intersection box) to not having more than one appearance of the same pair. If there are no other columns in the junction box, you won't be doing lookups of this table anyway, except by way of the two foreign keys.

提交回复
热议问题