views:

569

answers:

10

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!):

  • Association table
  • Bridge table
  • Cross-reference table
  • Gerund (E.F. Codd, creator of the relational model, may prefer this)
  • Intersection tables
  • Join table (most search results on Google...see answer below)
  • Junction table (Wikipedia favors this one)
  • Link table (Fowler likes this one)
  • Many-to-many relationship tables
  • Map table
  • Reference table
  • Relationship table
  • Swing table

Is there an official name for this kind of table, with a source to back its official-ness?

+9  A: 

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 :-)

SingleShot
+1 for answering the question...
Charles Bretana
A: 

I think Relationship table is more at the mark. At least that is what we use. By the way if you ask for naming we always use it this way table1_table2 with no exceptions. That will serve you well in the long term.

Cem Kalyoncu
+7  A: 

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.

Steve Wortham
The judges will also accept "XRef table"
Chris McCall
I think the answer is NO, there is no official single term for it...
Charles Bretana
I'm more familiar with junction tables but I've heard other phrases like cross-reference. I already +1'd you since you suggested googling for it. :)
Mayo
A: 

There's a section in SQL for Smarties where Celko had an opportunity to name this kind of table:

Tables that represent many-to-many relationships should be named by their contents, and should be as minimal as possible. For example, Students are related to Classes by a third (relationship) table for their attendence. These tables might represent a pure relationship, or (etc)...

At the top of the section he talks about E-R (entity-relationship) diagrams.

ChrisW
Thanks for the answer, but I'm not interested in the naming convention for the table (e.g. "UserGroup" or "user_group"). I'm looking for what those types of many-to-many tables are collectively called.
Noah Heldman
I think he's calling them "relationship" table.
ChrisW
Ah yes...sneaky! Thanks again.
Noah Heldman
+2  A: 

I've always called then intersection tables.

Lance Rushing
+1  A: 

I always just call them "many-to-many tables", or "many-to-many join tables". Seems the least likely to be misunderstood as something else. (I notice you used similar wording in the title of your question...)

Daniel Pryden
+2  A: 

I call them link tables, but I've called them that for so long that I have no clue where I got the term from.

MusiGenesis
A: 

Intersection table surely! I believe oracle also favor 'Intersection' tables.

http://download.oracle.com/docs/cd/B40099_02/books/ConfigApps/ConfigApps_TablesColumns7.html

JamesM
A: 

This is HIGHLY unscientific, but I thought it would be interesting to see how many Google results were associated with the combination of common answers to this question and the term "many to many".

Based on this, it looks like "join table" is the most commonly used term for the...um...joining table in a many-to-many relationship.


The combined search terms

"join table" "many to many"

return around 13,700 results in Google.

"link table" "many to many"

returns around 4,700.

"junction table" "many to many"

returns around 3,500.

"association table" "many to many"

returns around 3,300.

"relationship table" "many to many"

returns around 3,200.

"intersection table" "many to many"

returns around 1,500.

"cross-reference table" "many to many"

brings back 1,000.

gerund "many to many"

only returns 450.

Noah Heldman
A: 

I was told to call them 'link entities' when I first started work on relational databases (Dec Rdb almost 20 years ago). The 'entity' bit probably coming from the entity relationship diagrams the tables were in, although 'link tables' now sounds like a better fit from the same evolutionary tree.

Using @Noah's ground breaking research on Google this yields about 2000 references currently:

"link entity" "many to many"
amelvin