ID-dependent relationships

Download Report

Transcript ID-dependent relationships

David M. Kroenke’s
Database Processing:
Fundamentals, Design, and Implementation
Chapter Five:
Data Modeling with the
Entity-Relationship Model
Part Two
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-1
Strong Entity Patterns:
1:1 Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-2
Strong Entity Patterns:
1:1 Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-3
Identifying Strong Entities
• Has it’s own identifier
• Can exist, logically, without another entity
• Forget the database implementation
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-4
ERwin Symbol Summary
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-5
Strong Entity Patterns:
1:N Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-6
Strong Entity Patterns:
1:N Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-7
Strong Entity Patterns:
N:M Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-8
Strong Entity Patterns:
N:M Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-9
Strong Entity Patterns:
N:M Strong Entity Relationships
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-10
ID-Dependent Relationships:
Three Principle Patterns
1. Association (confused with M:N)
2. Multivalued Attribute
3. Version/instance
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-11
ID-Dependent Relationships:
The Association Pattern
Note the Price column,
which has been added.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-12
ID-Dependent Relationships:
The Association Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-13
ID-Dependent Relationships:
The Association Pattern
• Why confused with M:N?
• ERwin
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-14
ID-Dependent Relationships:
The Multivaled Attribute Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-15
ID-Dependent Relationships:
The Multivaled Attribute Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-16
ID-Dependent Relationships:
The Multivaled Attribute Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-17
ID-Dependent Relationships:
The Multivaled Attribute Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-18
ID-Dependent Relationships:
The Archtype/Instance Pattern
• Abstract or logical parent
• Child , the physical manifestation of parent
• Example
– CLASS (logical parent)
– SECTION (instance of parent)
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-19
ID-Dependent Relationships:
The Archtype/Instance Pattern
Note that these are
true ID-dependent
relationships the identifier of the
parent appears as
part of the
composite
identifier of the IDdependent child.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-20
No Longer ID-Dependent Children:
Rather Weak Children
Note the
use of
weak, but
not IDdependent
children.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-21
Non-ID-Dependent Weak Entities:
How Important?
• Logical Necessity?
• Business Rule Only?
• Erwin?
• This class?
• Back to Strong Entity
Patterns
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-22
Learning About Databases: The
Problem
1:M Relationships
Weak Entities
Strong Entities
ID-Dependent Entities
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-23
Mixed Patterns:
The Line-Item Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-24
Mixed Patterns:
The Line-Item Pattern
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-25
David M. Kroenke’s
Database Processing
Fundamentals, Design, and Implementation
(10th Edition)
End of Presentation:
Chapter Five Part Two
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition
© 2006 Pearson Prentice Hall, Modified by Dr. Lyn Mathis
5-26