Veri Tabanı4
Veri Tabanı4
Chapter 4
Entity Relationship (ER) Modeling
Last Revision: 25.10.2022
1
Objectives
3
Entities
4
Attributes
• Characteristics of entities
• Chen notation: attributes represented by ovals
connected to entity rectangle with a line
– Each oval contains the name of attribute it
represents
• Crow’s Foot notation: attributes written in
attribute box below entity rectangle
5
6
Attributes (cont’d.)
7
8
Attributes (cont’d.)
9
10
Attributes (cont’d.)
11
12
Relationships
13
Connectivity and Cardinality
• Connectivity
– Describes the relationship classification
• Cardinality
– Expresses minimum and maximum number of
entity occurrences associated with one
occurrence of related entity
• Established by very concise statements known
as business rules
14
15
Existence Dependence
• Existence dependence
– Entity exists in database only when it is
associated with another related entity
occurrence
• Existence independence
– Entity can exist apart from one or more related
entities
– Sometimes such an entity is referred to as a
strong or regular entity
16
Relationship Strength
17
18
19
Weak Entities
20
21
22
Relationship Participation
• Optional participation
– One entity occurrence does not require
corresponding entity occurrence in particular
relationship
• Mandatory participation
– One entity occurrence requires corresponding
entity occurrence in particular relationship
23
24
25
CHEN NOTATION
26
https://vertabelo.com/blog/chen-erd-notation/
CHEN NOTATION
27
https://vertabelo.com/blog/chen-erd-notation/
Relationship Degree
• Indicates number of entities or participants
associated with a relationship
• Unary relationship
– Association is maintained within single entity
• Binary relationship
– Two entities are associated
• Ternary relationship
– Three entities are associated
28
29
30
Recursive Relationships
31
32
33
Associative (Composite) Entities
34
35
36
Developing an ER Diagram
• Database design is an iterative process
– Create detailed narrative of organization’s
description of operations
– Identify business rules based on description of
operations
– Identify main entities and relationships from
business rules
– Develop initial ERD
– Identify attributes and primary keys that
adequately describe entities
– Revise and review ERD
37
38
39
40
41
42
43
44
45
46
47
48
49
Database Design Challenges:
Conflicting Goals
• Database designers must make design
compromises
– Conflicting goals: design standards, processing
speed, information requirements
• Important to meet logical requirements and
design conventions
• Design is of little value unless it delivers all
specified query and reporting requirements
• Some design and implementation problems do
not yield “clean” solutions
50
51
Summary
52
Summary (cont’d.)