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

发布于 2024-08-04 09:58:06 字数 624 浏览 2 评论 0原文

我参与过的大多数项目都需要数据库模式中的多对多关系。例如,您可能有“用户”和“组”的概念,并且数据库可能包含一个“用户”表、一个“组”表和一个将两者关联起来的“用户组”表。

我对该示例中 UserGroup 表的概念名称感兴趣。

我已经习惯称它们为“秋千桌”,因为我就是这样学会的,但我已经有一段时间没有听到其他人使用这个术语了。

相反,我听说过以下所有内容(包括一些新的,谢谢大家!):

  • 关联表
  • 桥接表
  • 交叉引用表
  • Gerund(EF Codd,关系模型的创建者,可能更喜欢这个)
  • 交集表
  • 连接表(Google 上的大多数搜索结果...参见下面的答案)
  • 连接表(维基百科偏爱这个)
  • 链接表 ( Fowler 喜欢这个)
  • 多对多关系表
  • 映射表 参考
  • 关系表
  • Swing 表

这种表有官方名称吗?有来源来支持其官方性吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

冰魂雪魄 2024-08-11 09:58:06

我称之为交叉引用表。

有些人可能不认为这是一个官方术语,但它确实是一个流行的术语。我的意思是,如果您搜索它。我喜欢的另一件事是它可以很容易地缩写为“xref”,然后在表命名方案中使用,例如“table1_xref_table2”。这会让团队中的每个人都称其为同一件事。

更新:

维基百科将其称为连接表。奇怪的是我从来没有听说过这个词,但我想不同的圈子对它有不同的称呼。正如我们所发现的——没有单一的官方答案。

2023 年更新:

维基百科现在将连接表重定向到“关联实体”。该页面目前似乎更喜欢术语“关联表”。该页面上给出了一长串术语:

关联表俗称有很多名称,包括关联表、桥接表、交叉引用表、人行横道、中间表、交集表、连接表、联结表、链接表、链接表、多对多解析器、地图表、映射表、配对表、数据透视表(在 Laravel 中错误使用 - 不要与电子表格中数据透视表的正确使用相混淆)或转换表。

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.

UPDATE in 2023:

Wikipedia now redirects junction table to "associative entity". That page currently seems to prefer the term associative table. There is a long list of terms given on that page:

Associative tables are colloquially known under many names, including 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, pairing table, pivot table (as used incorrectly in Laravel - not to be confused with the correct use of pivot table in spreadsheets), or transition table.

机场等船 2024-08-11 09:58:06

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

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

走过海棠暮 2024-08-11 09:58:06

这是非常不科学的,但我认为看看有多少谷歌结果与这个问题的常见答案和术语“多对多”的组合相关联会很有趣。

基于此,看起来“连接表”是...嗯...多对多关系中连接表最常用的术语。


组合搜索词

“连接表”“多对多”

在 Google 中返回大约 13,700 个结果。

“链接表”“多对多”

返回 4,700 左右。

“联结表”“多对多”

返回 3,500 左右。

“关联表”“多对多”

返回 3,300 左右。

“关系表”“多对多”

返回 3,200 左右。

“交集表”“多对多”

返回 1,500 左右。

“交叉引用表”“多对多”

返回 1,000。

动名词“多对多”

仅返回 450。

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.

橘虞初梦 2024-08-11 09:58:06

我总是将其称为交集表。

I've always called then intersection tables.

写给空气的情书 2024-08-11 09:58:06

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

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

2024-08-11 09:58:06

我称它们为链接表,但我已经这样称呼它们太久了,以至于我不知道我从哪里得到这个术语。

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.

我认为关系表更有意义。至少我们使用的是这样的。顺便说一句,如果您要求命名,我们总是以这种方式使用 table1_table2,无一例外。从长远来看,这会对你有好处。

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.

东京女 2024-08-11 09:58:06

在 Smarties 的 SQL 中有一个部分,Celko 有机会命名这种表:

表示多对多的表
关系应按其命名
内容,并且应该尽可能少
可能的。例如,学生是
与第三类相关
他们的(关系)表
出席。这些表可能
代表纯粹的关系,或
(等等)...

在本节的顶部,他讨论了 ER(实体关系)图。

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.

滿滿的愛 2024-08-11 09:58:06

当然是交叉点表!我相信甲骨文也喜欢“交集”表。

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

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

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

活泼老夫 2024-08-11 09:58:06

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

使用 @Noah 在 Google 上的开创性研究,目前可产生约 2000 个参考文献:

"link entity" "many to many"

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"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文