2

We are having a debate here at the shed about what we call the table that contains the two foreign keys of entities that you use to create a many to many relationship. Here are the names we have, which do you use?

  1. Linking Table
  2. Cross Table
  3. Relation Table
Daryl
  • 138
  • 1
  • 1
  • 10
  • 1
    possible duplicate of [Is there an official name for the many-to-many relationship table in a database schema?](http://stackoverflow.com/questions/1429908/is-there-an-official-name-for-the-many-to-many-relationship-table-in-a-database-s) – Gareth May 13 '11 at 19:02
  • 2
    The problem with "relation table" is that, in the relational data model, all tables represent relations. – Walter Mitty May 13 '11 at 21:26
  • Does this answer your question? [Is there an official name for the many-to-many relationship table in a database schema?](https://stackoverflow.com/questions/1429908/is-there-an-official-name-for-the-many-to-many-relationship-table-in-a-database) – philipxy Mar 04 '21 at 14:36

6 Answers6

2
4. Cross Reference.  

Describes what it actually does, is therefore intelligible to non-technical stakeholders, as in "We'll create a cross-reference for vendors and parts, listing which vendors supply which parts."

Note that "Relation table" if you use it would actually be "relationship table". The term "relation" is a term of art in relational database theory.

Ken Downs
  • 4,707
  • 1
  • 22
  • 20
1

None of the above. What exactly is the definition of the type of table you are trying to describe? My only understanding is this: you mean a table with more than one foreign key. I don't know of any better definition than that. But why would you want a special name for a table with more than one foreign key? Tables with more than one foreign key aren't very unusual or special. I would just call them tables and leave it at that.

nvogel
  • 24,981
  • 1
  • 44
  • 82
  • Not all tables with more than one key are the same. Consider a table of products. This might contain a foreign key for a category and a foreign key for a product group (to group for example different sizes of the same shoe). These foreign keys don't describe a relationship between categories and product groups. The product group almost certainly belongs to a category but this relationship is described elsewhere. – kaan_a Feb 28 '22 at 21:41
  • Alternatively consider a table of user roles consisting of a foreign key to the users table and a foreign key to the roles table. This table has the sole function of describing a many to many relationship between users and roles. It is this kind of table that is under discussion. And while there is no consensus as to what to call it, clearly it is worth distinguishing from other kinds of tables. – kaan_a Feb 28 '22 at 21:41
1

Wikipedia, calls it is an "associative table", "(also known as join table, junction table, or cross-reference table)".

It seems that calling it a "many-to-many table" might be clear to developers, while I appreciate @Ken Downs's example sentence to describe it "intelligibly to non-technical stakeholders" ("cross-reference for vendors and parts").

Abel Wenning
  • 483
  • 8
  • 6
0

Of the three: Cross-table. Just because I've heard that more often.

I'd prefer "Relation Table" before "Linking Table" - it links the items via their relationship.

Probably the best name would be "Join Table" -- since you're using it to join two other tables together, with extra details (optional).

I've also heard "Edge Table" -- any idea where that comes from?

Jeremy
  • 1
  • A network can be considered as composed of edges and vertexes. Someone might model the universe of discourse as a network, with "entities" treated as vertexes and "relationships" among entities treated as edges. – Walter Mitty May 14 '11 at 12:12
0

There's only one correct answer... cross table

0
  1. Junction Table.
  2. Relationship Table (as opposed to Entity Table)
Walter Mitty
  • 18,205
  • 2
  • 28
  • 58