csis115Lecture9

CSIS 115
Database Design and
Applications for Business
Dr. Meg Fryling
“Dr. Meg”
Fall 2012
@SienaDrMeg
#csis115
Agenda
• Homework (see next slide)
• Chapter 3 (100-105 only) & 5 – Data
Modeling
• Data Modeling the Hockey League
database
Homework
• Start Chapter 3 (skip 127-130)
• Start Chapter 6
• Homework 3
– Posted on Blackboard
– Due Weds, 10/10 by start of class
• Project – Part II
– Posted on Blackboard
– Due Weds, 10/17 by start of class
• Notice: Next Quiz is Mon, 10/15
1-3
Strong vs. Weak Review
• A strong entity is an entity whose
existence does NOT depend on another
entity
• A weak entity is an entity whose existence
depends on another entity
– identifier includes the identifier of another
entity
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-4
Weak Entities
Note: Text
considers
VEHICLE a
weak entity too
but we DO
NOT!
It’s just a
strong entity
with a required
parent.
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-5
Strong vs. Weak Entities
• Review the hockey league data model
– Which entities are strong?
– Which entities are weak?
A-8
Strong Entity Patterns
A-9
Determining Entity Patterns from
Forms and Reports
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-10
Entity Patterns
• Review the form and report on the
previous slide
– What are the entities?
– Are the entities strong or weak?
• ID-dependent?
– What is the minimum cardinality?
– What is the maximum cardinality?
5-11
Strong Entity Patterns:
1:1 Strong Entity Relationships
Are the minimum
cardinalities correct?
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-12
Determining Entity Patterns from
Forms and Reports
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-13
Entity Patterns
• Review the form on the previous slide
– What are the entities?
– Are the entities strong or weak?
• ID-dependent?
– What is the minimum cardinality?
– What is the maximum cardinality?
5-14
Strong Entity Patterns:
1:N Strong Entity Relationships
Note:
Foreign Key not
shown!
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-15
Non-ID-Dependent Entities
Note: Text considers VEHICLE
a weak entity too but we DO
NOT!
It’s simply a strong entity with
a required parent.
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-16
Determining Entity Patterns from
Forms and Reports
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-17
Determining Entity Patterns from
Forms and Reports
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-18
Entity Patterns
• Review the form and report on the
previous 2 slides
– What are the entities?
– Are the entities strong or weak?
• ID-dependent?
– What is the minimum cardinality?
– What is the maximum cardinality?
5-19
Strong Entity Patterns:
N:M Strong Entity Relationships
Can’t tell from JUST
the form or just the
report that the
relationship is N:M
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-20
Strong Entity Patterns:
N:M Strong Entity Relationships
SalesPrice is what we
retail the part for but
what if different
suppliers (companies)
charged us different
prices for the parts?
Where would we
store that info?
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-21
Weak Entities
ID-Dependent Relationships
A-22
ID-Dependent Relationships:
The Association Pattern
Our retail price
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
The prices suppliers
have charged us
5-23
ID-Dependent Relationships:
The Association Pattern
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition
© 2012 Pearson Prentice Hall
5-24
Conceptual Database Design
Data Modeling
In-Class Activity
Open Hockey League Activity
Word doc from Blackboard
Part 2 Only
Association Pattern
1-25
Consider this Report
• Draw the ER diagram, making note of any
assumptions you need to make.
A-26