EER - 示例中的识别和非识别关系

发布于 2024-11-05 05:07:40 字数 503 浏览 1 评论 0原文

如果我有三张表,一张用于用户,一张用于activationLink,一张用于位置

-usersactivationLink之间的关系是一种识别关系,因为特定的activationLink仅当用户在系统中注册时才存在。

-但是用户位置之间的关系是非标识性的,因为位置在没有用户的情况下也存在。

-如果存在一个名为users的表和另一个名为workerstudent的表,则workerstudent 可以在没有用户 的情况下存在吗?是非识别关系吗?

我的三点逻辑是否正确?

谢谢。

If i have three tables, One for users, one for activationLink and one for location.

-The relation between the users and activationLink is an identifying relationship because the specific activationLink only exists if the user is registered in the system.

-But the relation between users and location is non identifying, because the location exists without the users.

-And if exists a table called users and other called worker and student, the worker and student can exist without the users? is a non identifying relationship?

my logic is correct in the three points?

thanks.

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

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

发布评论

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

评论(2

酒与心事 2024-11-12 05:07:40

(1) User 和 ActivationLink 之间的关系并不完全清晰。

  • 一个ActivationLink 必须有一个用户(即与一个且仅一个用户相关)。
  • 但是,一个用户可以有多少个ActivationLink?零,一,零或更多,一或更多?

这可能是一种识别关系,但在做出决定之前我想了解更多。

(2)正确。用户和位置是(正如您在此处所描述的)独立的实体。

(3) 仅根据所用词语的典型含义,人们会假设“用户可以是学生或工人”,因此它们听起来像子类型......但这不可能是由现有信息证明或反驳。后续问题是:

  • 学生或工人是否可以不是用户?
  • 用户必须是学生还是工人?
  • 用户可以同时是学生和工人吗?
  • 或者,如果两者都不是,那么什么是用户?是否有第三个(或第四个或第五个或...)表指示这是什么类型或类型的用户?

(1) The relation between User and ActivationLink is not entirely clear as presented.

  • An ActivationLink must have a User (i.e. be related to one and only one user)
  • However, how many ActivationLinks can a User have? Zero, One, Zero or more, One or more?

It is probably an identifying relationship, but I'd like to know a bit more before comitting to it.

(2) Correct. Users and Locations are (as you have described here) separate entities.

(3) Based solely on the typical meanings derived from the words used, one would assume that "A User can be a Student or a Workder", so they sound like subtypes... but this cannot be proved or disproved by the information at hand. Followup questions are:

  • Can thre be Students or Workers who are not Users?
  • Must a User be either a Student or a Worker?
  • Can a User be both a Student and a Worker?
  • Alternatively, if neither, what is a User? Is there a third (or fourth or fifth or...) table indicating what kind or type of User this is?
栖迟 2024-11-12 05:07:40

“-用户和activationLink之间的关系是一种识别关系,因为特定的activationLink仅当用户在系统中注册时才存在。”

嗯嗯嗯嗯嗯。那么定义是,如果“没有 X”Y 不能存在,那么 x 和 Y 之间的关系就是“识别”的?

这与我受教时的记忆不完全一样。我想我已经被告知,如果关系本身(必然?)是(“子”实体的)键/标识符的一部分,那么该关系就是“标识”的。也就是说,父实体的逻辑键/标识符的属性也是子实体的逻辑键/标识符的一部分。您的示例中是这种情况吗?激活链接本身不是唯一的吗?多个不同的用户可以“共享”相同的激活链接吗?听起来很奇怪。

请注意,这个定义使这个概念变得肤浅,如果不是完全不适用的话,对于至少一侧没有“多”的关系(例如您的用户-工作人员关系)。

"-The relation between the users and activationLink is an identifying relationship because the specific activationLink only exists if the user is registered in the system."

Hmmmmmmmmmmmm. So the definition is then that a relationship between x and Y is "identifying" if the Y cannot exist "without the X" ?

That's not exactly what I remember from when I was taught. I think I've been told that a relationship is "identifying" if the relationship itself is (necessarily ?) part of the key/identifier (of the "child" entity). That is, that the attributes of the logical key/identifier of the parent entity are also part of the logical key/identifier of the child entity. Is this the case in your example ? Are activationlinks not unique by and of themselves ? Can several distinct users "share" the same activationlink ? Sounds odd.

Note that this definition makes the concept superficial, if not completely inapplicable, to relationships that do not have a "many" on at least one of its sides (such as your user-worker relationship, e.g.).

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