What are the basic rules for defining entities, attributes, and relationships in an ER-Diagram?

后端 未结 2 1148
悲&欢浪女
悲&欢浪女 2021-01-27 15:15

My question is: In order to exist which of the following needs obligatory to have key and attribute?

  • entity
  • entity-type<
2条回答
  •  有刺的猬
    2021-01-27 16:00

    In the original Entity-Relationship method, we identfy entity types and relationship/association types and their relevant attributes. When drawing an ER diagram we pick one or more groups of attributes that can identify an instance of a type as a key. If there isn't such an identifying group of attributes then we have to introduce an attribute as a surrogate. A type's value set (the set of its instances) will be represented by a relation/table.

    From Chen's 1976 The Entity-Relationship Model-Toward a Unified View of Data:

    Basically, an entity key is a group of attributes such that the mapping from the entity set to the corresponding group of value sets is one-to-one. If we cannot find such one-to-one mapping on available data, or if simplicity in identifying entities is desired, we may define an artificial attribute and a value set so that such mapping is possible.

    These are the only attributes we must have. (Surrogate attributes arise from this necessity.)

    If you are not interested in any non-key attributes of an entity type or relationship type, then you're not going to have any other attributes for it in your design/diagram.

    An ER diagram shows entity types and relationship types. It doesn't show entity instances or relationship instances.

提交回复
热议问题