【DBS】Lecture 05. E-R Model

Keys

keys

E-R Diagram

  • Rectangles represent entity sets.
  • Diamonds represent relationship sets.
  • Lines link attributes to entity sets and entity sets to relationship sets.
  • Ellipses represent attributes.
    • Double ellipses represent multivalued attributes.
    • Dashed ellipses denote derived attributes.
  • Underline indicates primary key attributes.

er

er2

  • We express cardinality constraints by drawing either a directed line (→), signifying “one”, or an undirected line (—), signifying “many”, between the relationship set and the entity set.

    er3

  • Total participation (全参与) (indicated by double line): every entity in the entity set participates in at least one relationship in the relationship set.
    E.g., participation of loan in borrower is total.
    Every loan must have a customer associated to it via borrower.

  • Partial participation (部分参与): some entities may not participate in any relationship in the relationship set.
    er4

  • An entity set that does not have a primary key is referred to as a weak entity set
    The discriminator or partial key (分辨符或部分码) of a weak entity set is the set of attributes that distinguishes among all those entities in a weak entity set that depend on one particular strong entity

    er5
    er6
    er7

    er8

    er9

    er10

    er11

  • 若一个对象只对其名字及单值感兴趣,则可作为属性,如性别;若一个对象除名字外,本身还有其他属性需描述,则该对象应定义为实体集。如电话, 部门.

  • 一个对象不能同时作为实体和属性.

  • 一个实体集不能与另一实体集的属性相关联,只能实体与实体相联系