Download presentation
Presentation is loading. Please wait.
1
TMC2034 Database Concept and Design
Data Modeling with ERD Updated on 13/10/2014 TMC2034 Database Concept and Design
2
TMC2034 Database Concept and Design
Objectives In this chapter, students will learn: The main characteristics of entity relationship components How relationships between entities are defined, refined, and incorporated into the database design process How ERD components affect database design and implementation That real-world database design often requires the reconciliation of conflicting goals TMC2034 Database Concept and Design
3
The Entity Relationship Model (ERM)
ER model forms the basis of an ER diagram ERD represents conceptual database as viewed by end user ERDs depict database’s main components: Entities Attributes Relationships TMC2034 Database Concept and Design
4
TMC2034 Database Concept and Design
5
TMC2034 Database Concept and Design
Entities Refers to entity set and not to single entity occurrence Corresponds to table and not to row in relational environment In Chen and Crow’s Foot models, entity is represented by rectangle with entity’s name The entity name, a noun, is written in capital letters TMC2034 Database Concept and Design
6
The Attributes of the Student Entity: Chen and Crow’s Foot
TMC2034 Database Concept and Design
7
TMC2034 Database Concept and Design
Examples of Entity TMC2034 Database Concept and Design
8
TMC2034 Database Concept and Design
Attributes Characteristics of entities Required attribute: Must have a value, cannot be left empty Optional attribute: Does not require a value, can be left empty Domain - Set of possible values for a given attribute Identifiers: One or more attributes that uniquely identify each entity instance TMC2034 Database Concept and Design
9
The Attributes of the Student Entity: Chen and Crow’s Foot
TMC2034 Database Concept and Design
10
TMC2034 Database Concept and Design
Attributes (cont’d.) Composite identifier: Primary key composed of more than one attribute Composite attribute: Attribute that can be subdivided to yield additional attributes Simple attribute: Attribute that cannot be subdivided Single-valued attribute: Attribute that has only a single value Multivalued attributes: Attributes that have many values TMC2034 Database Concept and Design
11
A Multivalued Attribute in an Entity
TMC2034 Database Concept and Design
12
TMC2034 Database Concept and Design
Attributes (cont’d.) Multivalued attributes: Attributes that have many values and require creating: Several new attributes, one for each component of the original multivalued attribute A new entity composed of the original multivalued attribute’s components Derived attribute: Attribute whose value is calculated from other attributes Derived using an algorithm TMC2034 Database Concept and Design
13
Depiction of a Derived Attribute
TMC2034 Database Concept and Design
14
Advantages and Disadvantages of Storing Derived Attributes
TMC2034 Database Concept and Design
15
TMC2034 Database Concept and Design
Attributes (cont’d.) TMC2034 Database Concept and Design
16
TMC2034 Database Concept and Design
Relationships Association between entities Participants are entities that participate in a relationship Relationships between entities always operate in both directions Relationship can be classified as 1:M Relationship classification is difficult to establish if only one side of the relationship is known TMC2034 Database Concept and Design
17
ER diagram of Branch Has Staff relationship
TMC2034 Database Concept and Design
18
Connectivity and Cardinality
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 TMC2034 Database Concept and Design
19
Connectivity and Cardinality in an ERD
TMC2034 Database Concept and Design
20
Semantic net of Staff Manages Branch relationship type
TMC2034 Database Concept and Design
21
Cardinality of Staff Manages Branch (1:1) relationship
TMC2034 Database Concept and Design
22
Semantic net of Staff Oversees PropertyForRent relationship type
TMC2034 Database Concept and Design Pearson Education © 2009
23
Cardinality of Staff Oversees PropertyForRent (1:*) relationship type
TMC2034 Database Concept and Design Pearson Education © 2009
24
Semantic net of Newspaper advertises PropertyForRent relationship type
TMC2034 Database Concept and Design
25
TMC2034 Database Concept and Design
Multiplicity of Newspaper Advertises PropertyForRent (*:*) relationship TMC2034 Database Concept and Design
26
TMC2034 Database Concept and Design
Existence Dependence TMC2034 Database Concept and Design
27
Relationship Strength
Weak (non-identifying) relationship Primary key of the related entity does not contain a primary key component of the parent entity Strong (identifying) relationships Primary key of the related entity contains a primary key component of the parent entity TMC2034 Database Concept and Design
28
A Weak (Non-Identifying) Relationship between COURSE and CLASS
TMC2034 Database Concept and Design
29
A Strong (Identifying) Relationship between COURSE and CLASS
TMC2034 Database Concept and Design
30
TMC2034 Database Concept and Design
Weak Entities Conditions Existence-dependent Has a primary key that is partially or totally derived from parent entity in the relationship Database designer determines whether an entity is weak based on business rules TMC2034 Database Concept and Design
31
TMC2034 Database Concept and Design
A Weak Entity in an ERD TMC2034 Database Concept and Design
32
A Weak Entity in a Strong Relationship
TMC2034 Database Concept and Design
33
TMC2034 Database Concept and Design
Strong vs weak entity TMC2034 Database Concept and Design
34
Relationship Participation
Optional participation One entity occurrence does not require a corresponding entity occurrence in a particular relationship Mandatory participation One entity occurrence requires a corresponding entity occurrence in a particular relationship TMC2034 Database Concept and Design
35
Table 4.3 - Crow’s Foot Symbols
TMC2034 Database Concept and Design
36
Figure 4.13 - CLASS is Optional to COURSE
TMC2034 Database Concept and Design
37
Figure 4.14 - COURSE and CLASS in a Mandatory Relationship
TMC2034 Database Concept and Design
38
Cardinality vs Participation
TMC2034 Database Concept and Design
39
TMC2034 Database Concept and Design
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 TMC2034 Database Concept and Design
40
Figure 4.15 - Three Types of Relationship Degree
TMC2034 Database Concept and Design
41
Figure 4.17 - An ER Representation of Recursive Relationships
TMC2034 Database Concept and Design
42
Recursive Relationships
Relationship can exist between occurrences of the same entity set Naturally found within unary relationship TMC2034 Database Concept and Design
43
TMC2034 Database Concept and Design
44
TMC2034 Database Concept and Design
45
Recursive relationship with role names
TMC2034 Database Concept and Design
46
Entities associated through two distinct relationships with role names
TMC2034 Database Concept and Design
47
Associative (Composite) Entities
Also known as bridge entities Used to implement M:N relationships Composed of primary keys of each of the entities to be connected May also contain additional attributes that play no role in connective process TMC2034 Database Concept and Design
48
Figure 4.25 - A Composite Entity in an ERD
TMC2034 Database Concept and Design
49
TMC2034 Database Concept and Design
Figure Converting the M:N Relationship into Two 1:M Relationships TMC2034 Database Concept and Design
50
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 TMC2034 Database Concept and Design
51
Figure 4.26 - The First Tiny College ERD Segment
TMC2034 Database Concept and Design
52
Figure 4.27 - The Second Tiny College ERD Segment
TMC2034 Database Concept and Design
53
Figure 4.28 - The Third Tiny College ERD Segment
TMC2034 Database Concept and Design
54
Figure 4.29 - The Fourth Tiny College ERD Segment
TMC2034 Database Concept and Design
55
Figure 4.30 - The Fifth Tiny College ERD Segment
TMC2034 Database Concept and Design
56
Figure 4.31 - The Sixth Tiny College ERD Segment
TMC2034 Database Concept and Design
57
Figure 4.32 - The Seventh Tiny College ERD Segment
TMC2034 Database Concept and Design
58
Figure 4.33 - The Eighth Tiny College ERD Segment
TMC2034 Database Concept and Design
59
Table 4.4 - Components of the ERM
TMC2034 Database Concept and Design
60
Database Design Challenges: Conflicting Goals
Database design must conform to design standards Need for high processing speed may limit the number and complexity of logically desirable relationships Need for maximum information generation may lead to loss of clean design structures and high transaction speed TMC2034 Database Concept and Design
61
TMC2034 Database Concept and Design
Figure Various Implementations of the 1:1 Recursive Relationship TMC2034 Database Concept and Design
62
TMC2034 Database Concept and Design
Question? TMC2034 Database Concept and Design
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.