gpt4 book ai didi

database - 弱实体数据库

转载 作者:搜寻专家 更新时间:2023-10-30 22:35:21 32 4
gpt4 key购买 nike

我对弱实体的了解是,如果没有强实体,它们就无法存在:-

即必须有一个强实体,弱实体必须从中获取 key (外键)。

示例:HOTEL(强实体)和 ROOM(弱实体),HOTEL 是强实体,因为他们可以(独立)拥有自己的存在,而 ROOM 是弱实体,因为他们总是需要没有它的 HOTEL(HOTEL)房间不存在。

但是在阅读本书时,我遇到了一个声明,该声明指出“但是并非每个存在的依赖性都会导致弱实体类型”。例如,除非 DRIVER_LICENCE 实体与 PERSON 实体相关,否则它不能存在,即使它有自己的实体key (licence_number),因此它不是弱实体。

我的问题是,一个依赖强实体的实体如何不能成为弱实体?

最佳答案

弱实体并不被定义为依赖于另一个实体存在,而是定义为依赖于另一个实体。

引自 Peter Chen 1976 年的论文“实体关系模型 - 统一数据 View ”:

...we have two forms of entity relations. If relationships are used for identifying the entities, we shall call it a weak entity relation. If relationships are not used for identifying the entities, we shall call it a regular entity relation. Similarly, we also have two forms of relationship relations. If all entities in the relationship are identified by their own attribute values, we shall call it a regular relationship relation. If some entities in the relationship are identified by other relationships, we shall call it a weak relationship relation. For example, any relationships between DEPENDENT entities and other entities will result in weak relationship relations, since a DEPENDENT entity is identified by its name and its relationship with an EMPLOYEE entity. The distinction between regular (entity/relationship) relations and weak (entity/relationship) relations will be useful in maintaining data integrity.

因此,由自身属性标识的实体称为常规实体,无论它是否可以独立存在或仅与另一个实体相关。

通过与另一个实体的关系来识别的实体必然依赖于它而存在,但该论点反之则不然。如果下雨,地面是湿的,但仅仅因为地面是湿的并不意味着下雨了。

关于database - 弱实体数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38279140/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com