开发者

What's the correct name for an "association table" (a many-to-many relationship) [closed]

开发者 https://www.devze.com 2023-01-03 07:26 出处:网络
Closed. This question is opinion-based. It is not currently accept开发者_JAVA技巧ing answers. Want to improve this question? Update the question so it can be answered with facts and citati
Closed. This question is opinion-based. It is not currently accept开发者_JAVA技巧ing answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 6 years ago.

Improve this question

What's the correct or most popular name for an "association table"?

I've heard lookup, associative, resolving, mapping and junction table.


There is no "correct" name, but the academic name would be an "Associative Table" (see See the Wikipedia article Associative Entity). Other common names are (in alphabetical order):

  • Association table
  • Bridge table
  • Cross-reference table
  • Crosswalk
  • Intermediary table
  • Intersection table
  • Join table
  • Junction table
  • Link table
  • Linking table
  • Many-to-many resolver
  • Map table
  • Mapping table
  • Pivot Table
  • Pairing table
  • Relationship table
  • Transition table

Note: This is contents original created by Derek Greer but that was posted as an edit to an accepted answer that totally changed the answer.


Cross reference table. CustomerProductXRef.


"Correct" depends on the modeling methodology in use. I am familiar with Chen, in which this table is the physical implementation of an Associative Entity. I suppose most popular would be directly related to most popular modeling methodology.

Wikipedia lists several names for this type of table.


I was taught and use the term "Join Table"


Depends on whom you ask. They're all correct, use the term that makes the most sense to who you're talking to.


Relationship table.

"One of the basic tricks in SQL is representing a many-to-many relationship. You create a third table that references the two (or more) tables involved by their primary keys. This third table has quite a few popular names, such as 'junction table' or 'join table,' but I know that it is a relationship."

Hollywood Couples by Joe Celko


Do you call your customer table CustomerTable or Customer or Customers? I generally use a "business object" name (eg Orders for information about which customers have ordered which products, not CustomerProduct) but a table that really just tracks the relationship, like SalesRepCustomer, I give the name of the two tables involved and don't add a suffix. As others say, be consistent.

I reserve the name lookup (in conversation, not in the table name) for things like "what is the name of Country 11", not for "which sales rep looks after Country 11".


We call these Crosswalk tables where I work. Naming is based on Table1XTable2 where the contents are the PKs of the 2 tables.

0

精彩评论

暂无评论...
验证码 换一张
取 消