清华大学数据库原理课件第二章.ppt
文本预览下载声明
数 据 库 原 理 王 建 民 清 华 大 学 软 件 学 院 2003年/秋 What Is in E-R Model? Main Contents Weak Entity Sets Extended E-R Features Design of an E-R Database Schema Reduction of an E-R Schema to Tables Weak Entity Sets An entity set that does not have a primary key is referred to as a weak entity set Strong entity set Depicted using double rectangle The existence of a weak entity set depends on the existence of a identifying entity set Identifying relationship depicted using a double diamond Keys for Weak Entity Sets The discriminator (or partial key) of a weak entity set is the set of attributes that distinguishes among all the entities of a weak entity set The primary key of a weak entity set is formed by the primary key of the strong entity set on which the weak entity set is existence dependent, plus the weak entity set’s discriminator Existing Dependency Example 1 Loans and Payments Example 2 Courses and Course-offerings Identifying Relationship Weak entity set must relate to the identifying entity set via a total relationship set A weak entity cant exist independently The identifying relationship must be one-to-many relationship set from the identifying to the weak entity set Questions about WESs Can the entity set participate in other than the identifying relationship? Can the WES have more than one owners? Give a example Can the owners primary keys be explicitly stored in WES? WES or Multi-valued Attributes? Entities vs. Attributes Main Contents Weak Entity Sets Extended E-R Features Design of an E-R Database Schema Reduction of an E-R Schema to Tables Relationship A relationship is an association among several entities The nature of their inter-connections The way they are connected The required integrity rules and constraints Is there relationship types other than the ‘verb’? Scenario 1 Is-A Relationship Higher-level entity Supertypes or Superclasses Combine the common characteristics of subtypes lower-level entity Subtypes or Subclasses Exhibit
显示全部