未识别的关系和外键
如果我有两个未识别的关系,FK_one
和 FK_two
。 我不能将它们作为单个主键的唯一方法是当我将 PK 添加到 FK_one 和 FK_two 时,但如果我这样做,关系现在是确定。
所以我的问题是:如果它们是已识别的关系,我只能有两个外键作为 PK,对吗?否则,即使我有两个或多个 FK(未识别的关系),它们也不能用作 PK
if i have two non identified relationships, FK_one
and FK_two
.
The only way, that i cant put them as a single primary key is when i add PK to the FK_one
and FK_two
, but if i do that, the relation is now an identified.
So my question is: i can only have two foreign keys as a PK if they are an Identified relationship, correct? otherwise they can't be used as PK even if I have two or more FK (non Identified relationships)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已识别的关系是用 2 个或更多 FK 作为主键且没有代理键来“识别”的。因此,您最终会得到一个组合主键,但据我所知,您可以拥有所需的所有主键,但这对服务器性能不利。
An identified relationship is "identified" with 2 or more FKs as primary keys and without a surrogate key. So you end up with a composed primary key, but as far as I know you can have all the primary keys you want but that's not good for the server performance.