Title: EntityRelationship Modeling
1Entity-Relationship Modeling
2Outline
- Basic Concept
- Advanced Concept
- Examples and Exercises
3(No Transcript)
4Enterprise schema-an intermediate step in
logical data base design
5Entity Relationship Model
- E/R approach
- E/R concept
- Entity
- Relationships
- Attributes
6An Example EER Model
6
7Entity
- An object that exists and distinguishable from
other objects - Concrete Entity Vs. Abstract Entity
- Weak Entity Vs. Regular Entity
8Basic Concepts
- Entity Sets Group of similar entities
- Attribute / Property A function that maps an
entity set into a domain ( value set ) - Domain Set of permissible values for an
attribute
9(No Transcript)
10(No Transcript)
11Keys
- Attribute whose values uniquely identify each
entity in an entity set - Candidate key
- Primary key
12Relationship
- Association among several entities, ordered list
of entity sets - Relationship set set of relationships of the
same type
13(No Transcript)
14E-R Diagrams
- Graphical representation of the logical design of
a database - Rectangles represent entity sets
- Circles or ellipses represent attributes
- Diamonds represent relationship sets
- Links connect attributes to entity sets and
entity sets to relationships
15(No Transcript)
16Functionality of Relationships
- Mapping Cardinality Number of entities of one
set that can be associated with another entity
via relationship. - Indicate functionality through the use of
directed arcs - One-to-one
- One-to-many
- Many-to-one
- Many-to-many
17(No Transcript)
18(No Transcript)
19(No Transcript)
20Many-to many an entity in A is associated with
any number of entities in B and an entity in B is
associated with any number of entities in A.
Many-to-many relationship
21- All entities in a relationship need not to be
distinctive - recursive relationship sets
- two relationship sets between the same two entity
sets - Relationship may have descriptive attributes
- relationship sets have primary keys
- A relationship may be n-ary
22All entities in a relationship need not be
distinct
- E.g. Recursive relationship set
Role function played by an entity in a
relationship More than one relationship set
possible between 2 entity sets
23Two relationship sets between the same entity sets
24Relationship may have descriptive attributes
Relationship sets have primary keys
25Ternary Relationship
- Doctors-patients-tests
- Customers-accounts-branches
26Abstraction
- ability to hide detail and concentrate on
- general, common properties of a set of
- objects
- Generalization/Specialization Abstraction
- captured by generalization hierarchies or subsets
- applied only to entities
- take the union of two or more lower level entity
sets to produce a higher level entity set.
27(No Transcript)
28(No Transcript)