0% found this document useful (0 votes)
9 views

Advanced Data Modeling

Uploaded by

Tan Yi Ting
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Advanced Data Modeling

Uploaded by

Tan Yi Ting
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

CT004-3.

5-3
Advanced Database Systems

Advanced Data Modeling


Topic & Structure of Lesson

• The relevance of data modelling to the relational model


• Problems with ER Models
• Developing Enhanced Entity Relationship Modelling
• Specialization/generalization hierarchies

Module Code & Module Title Slide Title SLIDE 2


Learning Outcomes

By the end of this lesson you should be able to:

• Explain the relevance of data modelling to the


relational model
• Explain and develop enhanced Entity Relationship
Modelling
• Describe specialization/generalization hierarchies

Module Code & Module Title Slide Title SLIDE 3


ER Modelling

• ER Modelling is a very effective tool for standard relational DB tasks

• Provides semantic information but not always sufficient

• Less adapted for more complex semantics

Module Code & Module Title Slide Title SLIDE 4


The Database Design Process

Requirements Definition

Data Analysis

Conceptual data model

Logical data model

Physical Design

Database

Module Code & Module Title Slide Title SLIDE 5


Problems with ER Models

• Problems may arise when designing a conceptual


data model called connection traps.
• Often due to a misinterpretation of the meaning of
certain relationships.
• Two main types of connection traps are called fan
traps and chasm traps.

Module Code & Module Title Slide Title SLIDE 6


6
Problems with ER Models

• Fan Trap
- Where a model represents a relationship between entity types, but
pathway between certain entity occurrences is ambiguous.

• Chasm Trap
- Where a model suggests the existence of a relationship between entity
types, but pathway does not exist between certain entity occurrences.

Module Code & Module Title Slide Title SLIDE 7


7
An Example of a Fan Trap

Module Code & Module Title Slide Title SLIDE 8


8
Semantic Net of ER Model with Fan Trap

• At which branch office does staff number SG37


work?

Module Code & Module Title Slide Title SLIDE 9


9
Restructuring ER model to remove Fan
Trap

Module Code & Module Title Slide Title SLIDE 10


10
Semantic Net of Restructured ER Model with Fan Trap
Removed

• SG37 works at branch B003.

Module Code & Module Title Slide Title SLIDE 11


11
An Example of a Chasm Trap

Module Code & Module Title Slide Title SLIDE 12


12
Semantic Net of ER Model with Chasm
Trap

• At which branch office is property PA14 available?

Module Code & Module Title Slide Title SLIDE 13


13
ER Model restructured to remove Chasm
Trap

Module Code & Module Title Slide Title SLIDE 14


14
Semantic Net of Restructured ER Model with Chasm Trap
Removed

Module Code & Module Title Slide Title SLIDE 15


15
The Extended Entity Relationship Model
• Result of adding more semantic constructs to original entity relationship (ER) model

• Diagram using this model is called an EER diagram (EERD)

Module Code & Module Title Slide Title SLIDE 16


Entity Supertypes and Subtypes
• Entity supertype
– Generic entity type that is related to one or more entity subtypes
– Contains common characteristics
• Entity subtypes
– Contains unique characteristics of each entity subtype

Module Code & Module Title Slide Title SLIDE 17


Entity Supertypes and Subtypes (continued)

Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel
Module Code & Module Title Slide Title SLIDE 18
•Specialization Hierarchy
Depicts arrangement of higher-level entity supertypes (parent entities)
and lower-level entity subtypes (child entities)
• Relationships sometimes described in terms of “IS-A” relationships
• Subtype can exist only within context of supertype and every subtype
can have only one supertype to which it is directly related
• Can have many levels of supertype/subtype relationships

Module Code & Module Title Slide Title SLIDE 19


Specialization Hierarchy
(continued)

Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel
Module Code & Module Title Slide Title SLIDE 20
Specialization Hierarchy (continued)

• Support attribute inheritance


• Define special supertype attribute known as subtype
discriminator
• Define disjoint/overlapping constraints and complete/partial
constraints

Module Code & Module Title Slide Title SLIDE 21


Inheritance
• Enables entity subtype to inherit attributes and relationships of
supertype
• All entity subtypes inherit their primary key attribute from their
supertype
• At implementation level, supertype and its subtype(s) depicted in
specialization hierarchy maintain a 1:1 relationship

Module Code & Module Title Slide Title SLIDE 22


Inheritance (continued)

Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel
Module Code & Module Title Slide Title SLIDE 23
Subtype Discriminator

• The attribute in supertype entity that determines to which entity subtype


each supertype occurrence is related
• The default comparison condition for subtype discriminator attribute is
equality comparison

Module Code & Module Title Slide Title SLIDE 24


•Disjoint
Disjoint and Overlapping Constraints
subtypes
– Also known as non-overlapping subtypes
– Subtypes that contain unique subset of supertype entity set
• Overlapping subtypes
– Subtypes that contain nonunique subsets of supertype entity set

Module Code & Module Title Slide Title SLIDE 25


Disjoint and Overlapping
Constraints (continued)

Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel
Module Code & Module Title Slide Title SLIDE 26
Disjoint and Overlapping
Constraints (continued)

Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel
Module Code & Module Title Slide Title SLIDE 27
Completeness Constraint

• Specifies whether each entity supertype occurrence must also be member of at least one
subtype
• Can be partial or total

Module Code & Module Title Slide Title SLIDE 28


Completeness Constraint
(continued)

Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel
Module Code & Module Title Slide Title SLIDE 29
Specialization and Generalization

• Specialization
– Top-down process of identifying lower-level, more specific entity subtypes from higher-level entity
supertype
– Based on grouping unique characteristics and relationships of the subtypes

Module Code & Module Title Slide Title SLIDE 30


Specialization and Generalization
(continued)

• Generalization
– Bottom-up process of identifying higher-level, more generic entity supertype from lower-level entity
subtypes
– Based on grouping common characteristics and relationships of the subtypes

Module Code & Module Title Slide Title SLIDE 31

You might also like