数据库作业答案—ch.ppt

数据库作业答案—ch

Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping Constraints Keys E-R Diagram Extended E-R Features Design of an E-R Database Schema Reduction of an E-R Schema to Tables 2.1 Basic Concepts Entity Sets A database can be modeled as: a collection of entities(实体), Relationship(联系) among entities. An entity is an object that exists and is distinguishable from other objects. Example: specific person, company, event Entities have attributes(属性) Example: people have names and addresses An entity set(实体集) is a set of entities of the same type that share the same properties. Example: set of all persons, companies, trees, holidays Entity Sets customer and loan Attributes An entity is represented by a set of attributes, that is descriptive properties possessed by all members of an entity set. Domain(域) – the set of permitted values for each attribute Attribute types: Simple and composite(复合) attributes. Single-valued and multi-valued attributes (upper and lower bounds) E.g. multivalued attribute: phone-numbers Derived attributes(派生属性) Can be computed from other attributes E.g. age, given date of birth Composite Attributes Relationship Sets A relationship(联系) is an association among several entities Example: Hayes depositor A-102 customer entity relationship set account entity A relationship set(联系集) is a mathematical relation among n ? 2 entities, each taken from entity sets {(e1, e2, … en) | e1 ? E1, e2 ? E2, …, en ? En} where (e1, e2, …, en) is a relationship Example: (Hayes, A-102) ? depositor Relationship Set borrower Relationship Sets (Cont.) An attribute can also be property of a relationship set. For instance, the depositor relationship set between entity sets customer and account may have attribute access-date Relationship Sets (Cont.) A relationship instance in a given relationship set must be uniquely identifiable from its participating entities, without using the

文档评论(0)

1亿VIP精品文档

相关文档