0

I confused about these two concept? are they same or different? I know what is manay to many relationship and we have one junction table which connect two other tables with two FK it means in junction table I have three feilds one ID primarykey and two FK but what is defferences between that and when we have junction table which has Two PK and then relate other tables.

first case junction table contains ID PK , user id Fk , Country id FK

second case junction table contains user id Pk ,Country id PK

enter image description here

bansi
  • 55,591
  • 6
  • 41
  • 52
Mfanoosh
  • 35
  • 10
  • Possible duplicate of [Many to Many Relationship](http://stackoverflow.com/questions/37238237/many-to-many-relationship) – MikaelF Mar 02 '17 at 01:28

1 Answers1

0

Concepts are different. In first case you can have more than one relation between the same rows in main tables, in second - not, unique index won't allow this.

Sergey S.
  • 6,296
  • 1
  • 14
  • 29