主要钥匙可以在两个不同表中充当外键吗?

发布于 2025-02-11 17:26:03 字数 200 浏览 0 评论 0原文

我当前正在制作基本的Minecraft项目列表数据库设计,并且我想知道我是否可以在评论表和列表表中使用外键参考ID_PLAYER =“ nofollow noreferrer”> “

Im currently making a basic minecraft item listing database design, and im wondering if i can reference id_player with a foreign key in the Reviews Table and Listing Tableenter image description here

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

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

发布评论

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

评论(1

怀里藏娇 2025-02-18 17:26:03

是的,您可以有多个约束,可以引用相同的主要(或唯一)约束。

如果愿意,则最多可以拥有4,294,967,292个外键,该键参考相同的主键(因为数据库中的最大约束数为4,294,967,293,但您需要一个主密钥约束)。

来自 oracle数据库参考,附录A.3逻辑数据库限制

此表描述了逻辑数据库项目的限制类型和限制值。

项目限制的类型限制值
约束最大每列

无限

Oracle不能定义每列约束数的限制。但是,约束受到数据库中最大约束数量的限制。请参阅“ 约束 - 每个数据库最大”在此表中。

约束每个数据库最大值4,294,967,293

Yes, you can have multiple constraints that can reference the same primary (or unique) constraint.

If you wanted to, you could have up to 4,294,967,292 foreign keys that reference the same primary key (since the maximum number of constraints in a database is 4,294,967,293 but you would need one primary key constraint).

From the Oracle Database Reference, Appendix A.3 Logical Database Limits

This table describes limit types and limit values for logical database items.

ItemType of LimitLimit Value
ConstraintsMaximum per column

Unlimited

Oracle does not define a limit on the number of constraints per column. However, constraints are subject to the limit on the maximum number of constraints in the database. See the entry for "Constraints - Maximum per database" in this table.

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