Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an official name for the many-to-many relationship table in a database schema?

Tags:

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?

like image 971
Noah Heldman Avatar asked Sep 15 '09 22:09

Noah Heldman


People also ask

What is the many-to-many relationship table called?

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.

Can you have a many-to-many relationship in a database?

Relational database systems usually don't allow you to implement a direct many-to-many relationship between two tables.

How do you name a many-to-many table in SQL?

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

What type of table is required if a many-to-many relationship is found in a relational database?

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.


2 Answers

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.

like image 114
Steve Wortham Avatar answered Sep 22 '22 05:09

Steve Wortham


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

like image 35
SingleShot Avatar answered Sep 22 '22 05:09

SingleShot