Skip to content
Advertisement

Foreign key relationship with composite primary keys in MySQL

Which is the best way to create a relationship between two tables when referenced table has a composite primary key?

Advertisement

Answer

One way is this

As Gordon said, the best option is create an auto incremental ID and make this the primary key.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement