在ER图中定义实体,属性和关系的基本规则是什么? [英] What are the basic rules for defining entities, attributes, and relationships in an ER-Diagram?

查看:781
本文介绍了在ER图中定义实体,属性和关系的基本规则是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是: 为了存在以下哪些条件,需要强制具有键的属性?

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

  • 实体
  • 实体类型
  • 关系类型
  • 关系(具有关系类型的元组)

我知道我的问题有点奇怪,但是我不确定建立ER图的规则是什么.换句话说,在我的图表中应该显示哪些是强制性的,而不是哪些(例如属性). 预先感谢.

I know my question is a little bit odd, but I am not quite sure what are the rules by building an ER-Diagram. In other words what should mandatory be present in my diagram and what not (e.g Attributes). Thanks in advance.

推荐答案

在原始的Entity-Relationship方法中,我们确定实体类型和关系/关联类型及其相关属性.在绘制ER图时,我们选择一组或多组可以将类型实例标识为键的属性.如果没有这种可识别的属性组,那么我们必须引入一个属性作为替代.类型的值集(其实例集)将由关系/表表示.

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.

根据Chen的1976年的实体-关系模型"-走向统一的数据视图:

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.

ER图显示了实体类型和关系类型.它不显示实体实例或关系实例.

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

这篇关于在ER图中定义实体,属性和关系的基本规则是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆