Most of the projects I've worked on have required many-to-many relationships in the database schema. For example, you might have the concept of Users and Groups, and the database might contain a table User, a table Group, and a table UserGroup to relate the two.
I'm interested in the conceptual name of the UserGroup table in that example.
I've grown accustomed to calling them "swing tables" because that's how I learned it, but I haven't heard other people use that term in a while.
Instead, I've heard all of the following (including some new ones, thanks to all of you!):
Is there an official name for this kind of table, with a source to back its official-ness?
Junction table. When you need to establish a many-to-many relationship between two or more tables, the simplest way is to use a Junction Table. A Junction table in a database, also referred to as a Bridge table or Associative Table, bridges the tables together by referencing the primary keys of each data table.
Relational database systems usually don't allow you to implement a direct many-to-many relationship between two tables.
The ORM suggests pluralizing table names, using all lowercase names, and using underscores for many-to-many table names. So for your example, you'd have the following tables: clients, brokers, and brokers_clients (the ORM suggests alphabetically arranging table names for many-to-many tables).
Many to Many A many-to-many relationship is really two one-to-many relationships with a third table. A many-to-many relationship means that for each record in one table there can be many records in another table and for each record in the second table there can be many in the first.
I call it a cross-reference table.
Some may not consider this an official term, but it's certainly a popular one. I mean, you'll find plenty of relevant results in Google if you search for it. The other thing I like is that it can be easily abbreviated "xref" and then used in your table naming scheme, e.g. "table1_xref_table2". That'll get everyone on your team calling it the same thing.
UPDATE:
Wikipedia calls it a junction table. It's strange that I've never heard that term but I suppose different circles call it different things. As we're finding out -- there is no single official answer.
The most common name is "Join Table" in my opinion, but I have heard several others you have listed. So, I would say "no", there is no "official" name :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With