Does a Join table (association table) have a primary key ? many to many relationship. I’ve seen some Join tables with a primary key and some without can someone please explain when you would have a primary key in a join table and why?
Thank you in advance;-)
In a pure ‘join’ or junction table all the fields will be part of the primary key. For example let’s consider the following tables:
A junction table between these to allow many users to have many attributes would be
Sometimes you’ll find the need to add a non-primary column to a junction table but I find this is relatively rare.
Share and enjoy.