数据库模式中有多对多关系表的正式名称吗?

时间:2020-11-29 06:53:07

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.

我所研究的大多数项目都需要数据库模式中的多对多关系。例如,您可能有用户和组的概念,并且数据库可能包含一个表用户、一个表组和一个表UserGroup来关联这两者。

I'm interested in the conceptual name of the UserGroup table in that example.

我对这个示例中的UserGroup表的概念名感兴趣。

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.

我已经习惯了称它们为“swing表”,因为这是我学习它的方式,但我还没有听到其他人在一段时间内使用这个术语。

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)
  • Gerund (E.F. Codd,关系模型的创建者,可能更喜欢这个)
  • Intersection tables
  • 交叉表
  • Join table (most search results on Google...see answer below)
  • 连接表(谷歌上的大多数搜索结果……)见下面的回答)
  • Junction table (Wikipedia favors this one)
  • 连接表(*喜欢这个)
  • Link table (Fowler likes this one)
  • 链接表(Fowler喜欢这个)
  • 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?

这种桌子有官方名称吗?

10 个解决方案

#1


13  

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

在我看来,最常见的名字是“Join Table”,但我听说您还列出了其他几个名字。所以,我会说“不”,没有“官方”的名字:-)

#2


15  

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.

有些人可能不认为这是官方的说法,但它确实很受欢迎。我的意思是,如果你搜索谷歌,你会发现很多相关的结果。我喜欢的另一件事是它可以很容易地缩写为“xref”,然后在您的表命名方案中使用。“table1_xref_table2”。这会让你的团队中的每个人都把它叫做相同的东西。

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.

*称它为连接表。奇怪的是,我从来没听过这个词,但我想不同的圈子把它叫做不同的东西。正如我们所发现的——没有一个单一的官方答案。

#3


8  

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"

"join table" "many to many to many"

return around 13,700 results in Google.

在谷歌中返回约13700个结果。

"link table" "many to many"

“链接表”“多到多”

returns around 4,700.

在4700年左右返回。

"junction table" "many to many"

"汇合表" "多对多"

returns around 3,500.

在3500年左右返回。

"association table" "many to many"

"联想表" "多对多"

returns around 3,300.

在3300年左右返回。

"relationship table" "many to many"

"关系表" "多对多"

returns around 3,200.

在3200年左右返回。

"intersection table" "many to many"

"交集表" "多对多"

returns around 1,500.

在1500年左右返回。

"cross-reference table" "many to many"

"交叉参照表" "多对多"

brings back 1,000.

带来1000。

gerund "many to many"

动名词“很多很多”

only returns 450.

只返回450。

#4


4  

I've always called then intersection tables.

我总是调用交集表。

#5


3  

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.

我把它们叫做链接表,但是我给它们起了这么长时间,我都不知道这个词是从哪里来的。

#6


1  

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.

我认为关系表更准确。至少我们是这么用的。顺便说一下,如果你要求命名我们总是这样使用表1_table2,没有例外。从长远来看,这对你很有好处。

#7


1  

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

在SQL的Smarties一节中,Celko有机会为这类表命名:

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.

在这一部分的顶部,他谈到了E-R(实体-关系)图。

#8


1  

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

我总是称它们为“多对多表”或“多对多表”。似乎最不可能被误解为其他的东西。(我注意到你在你的问题标题中使用了类似的措辞……)

#9


0  

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

交叉表肯定!我相信oracle也喜欢“交集”表。

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

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

#10


0  

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.

当我第一次开始研究关系数据库(大约20年前的Dec Rdb)时,我被告知要称它们为“链接实体”。“实体”位可能来自表所在的实体关系图,尽管“链接表”现在听起来更适合同一棵进化树。

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

使用@Noah关于谷歌的突破性研究,目前大约有2000篇参考文献:

"link entity" "many to many"

#1


13  

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

在我看来,最常见的名字是“Join Table”,但我听说您还列出了其他几个名字。所以,我会说“不”,没有“官方”的名字:-)

#2


15  

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.

有些人可能不认为这是官方的说法,但它确实很受欢迎。我的意思是,如果你搜索谷歌,你会发现很多相关的结果。我喜欢的另一件事是它可以很容易地缩写为“xref”,然后在您的表命名方案中使用。“table1_xref_table2”。这会让你的团队中的每个人都把它叫做相同的东西。

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.

*称它为连接表。奇怪的是,我从来没听过这个词,但我想不同的圈子把它叫做不同的东西。正如我们所发现的——没有一个单一的官方答案。

#3


8  

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"

"join table" "many to many to many"

return around 13,700 results in Google.

在谷歌中返回约13700个结果。

"link table" "many to many"

“链接表”“多到多”

returns around 4,700.

在4700年左右返回。

"junction table" "many to many"

"汇合表" "多对多"

returns around 3,500.

在3500年左右返回。

"association table" "many to many"

"联想表" "多对多"

returns around 3,300.

在3300年左右返回。

"relationship table" "many to many"

"关系表" "多对多"

returns around 3,200.

在3200年左右返回。

"intersection table" "many to many"

"交集表" "多对多"

returns around 1,500.

在1500年左右返回。

"cross-reference table" "many to many"

"交叉参照表" "多对多"

brings back 1,000.

带来1000。

gerund "many to many"

动名词“很多很多”

only returns 450.

只返回450。

#4


4  

I've always called then intersection tables.

我总是调用交集表。

#5


3  

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.

我把它们叫做链接表,但是我给它们起了这么长时间,我都不知道这个词是从哪里来的。

#6


1  

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.

我认为关系表更准确。至少我们是这么用的。顺便说一下,如果你要求命名我们总是这样使用表1_table2,没有例外。从长远来看,这对你很有好处。

#7


1  

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

在SQL的Smarties一节中,Celko有机会为这类表命名:

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.

在这一部分的顶部,他谈到了E-R(实体-关系)图。

#8


1  

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

我总是称它们为“多对多表”或“多对多表”。似乎最不可能被误解为其他的东西。(我注意到你在你的问题标题中使用了类似的措辞……)

#9


0  

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

交叉表肯定!我相信oracle也喜欢“交集”表。

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

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

#10


0  

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.

当我第一次开始研究关系数据库(大约20年前的Dec Rdb)时,我被告知要称它们为“链接实体”。“实体”位可能来自表所在的实体关系图,尽管“链接表”现在听起来更适合同一棵进化树。

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

使用@Noah关于谷歌的突破性研究,目前大约有2000篇参考文献:

"link entity" "many to many"