在这个 ERD 场景中存在歧义

There in an ambiguity in this ERD scenario

Consider the N&N database application regarding different publishers. The publishers publish books written by various authors. The books can be published only after signing contract with the authors. The authors may sign contact with different publishers and a publisher may sign contract with different author. A publisher may publish more than one books whereas no two publishers can publish same book written by same author. Each contract between publisher and author contains contract start date, end date and contract cancellation penalty. A person will be considered as an author if he writes at least one book and each book is written by at least one author. N&N keeps publisher name, address and max two phone numbers (personal, office) as record of publishers. For authors the organization keeps their identification number F_Name, L_Name, P_NO , DOB to calculate the age, subject areas, Address in which HNO, Street NO, Postal Code is kept as record. There may be more than one authors writing books on same subject area and an author may write books of different subject areas. The book is identified by ISBN. It has title, number of pages, the year of publication and category. There may be more than one books belonging to same category but one book must belong to at-max one category.

在这种情况下,类别会有一个单独的实体吗? 和 作者出版商和合同之间是否存在三级关系?

  1. 该类别是否有单独的实体?

Ref:该书由 ISBN 标识。它有标题、页数、出版年份和类别。 Ans:这一行表明类别是 Book

的 single-valued 属性

参考:同一类别的图书可能不止一本,但一本书最多只能属于一个类别。

Ans:这一行说明不同的书可以有相同的类别属性,但是一本书不能有多个类别,这个属性必须是NOT-NULL

因此,类别将是图书的属性。


  1. 作者、出版商和合同之间是否存在三级关系?

Ref: 与作者签订合同后方可出版。

Ans:这一行说明应该是三元关系。 出版商与作者签署联系方式,反之亦然。

类别

实体、关系、属性和关联实体之间的区别本质上是任意的。

唯一的类别关系是"book B ... and has category C"。一本书参加了 0 次或 1 次。我们不会被告知是否有类别没有书籍,即类别是否必须参加。一个类别可以多次参与。

如果关系是 0 或 1 到 1 或更多,则所有类别都参与。所以如果你想知道所有的类别,那么它们就是关系中的类别。所以一个类别可以是 属性 一本书(或者是一个实体)。否则(关系是 0-or-1 到 0-or-more)我们需要知道不参与的类别。如果现存的类别永远不会改变,那么它们可以 1:1 具有域的值。所以类别可以是 属性 本书(或者可以是实体)。否则类别来来去去,所以它们需要是实体。考虑到没有涉及类别来来去去或是否必须与一本书相关联,最简单的情况是类别域,因此类别property/attribute就足够了。

作者-出版商-合同

这三种实体类型有许多 三元关系。你想知道的是是否应该有一个 base

我们知道 "author A and publisher P signed a contract"。但尚不清楚作者和出版商是否可以签订一份以上的合同。例如不清楚每本书是否都有合同。

如果只能有一个合同,那么就不需要基础关系"author A and publisher P signed contract C"。否则(可以有多个合同)你需要一个三元关系。考虑到没有进去,最简单的答案就是不要。

根据要求

仅仅了解所有相关关系和事物来绘制 ERD 是不够的。当事物被视为实体时,我们需要知道所有基本关系和完整基数。然后根据限制,我们可以将实体降级为 属性 或关系。您应该要求填写的要求。