文档介绍:Chapter 2: Entity-Relationship Model
Basic Concepts
Constraints
Keys
Design Issues
E-R Diagram
Weak Entity Sets
Extended E-R Features
Design of an E-R Database Schema
Reduction of an E-R Schema to Tables
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, plant
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
customer-id customer- customer- customer- loan- amount name street city number
Basic Concepts (Cont.)
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 posite attributes.
Single-valued and multi-valued attributes
. multivalued attribute: phone-numbers
Derived attributes
Can puted from other attributes
. age, given date of birth
Composite Attributes
Basic Concepts (Cont.)
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
Basic Concepts(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 the attribute access-date
Basic Concepts(Cont.)
Degree of a Relationship Set
Refers to number of entity sets that participate in a relationship set.
Relationship sets that involve