CSIS 115 Database Design and Applications for Business

Slides:



Advertisements
Similar presentations
Data Modeling and the Entity-Relationship Model
Advertisements

Data Modeling and the Entity-Relationship Model
Database Lecture Notes Mapping ER Diagrams to Tables 2 Dr. Meg Murray
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 3 rd Edition.
(wrapping up from last week)
Entity-Relationship Model
Data Modeling and the Entity-Relationship Model
Data Modeling and the Entity-Relationship Model
Copyright © 2015 Pearson Education, Inc. Database Design Chapters 17 and
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the ER Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 9.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 10.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 8.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 COS 346 Day 7.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 7.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 8.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 6.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 6 Database Design Using Entity- Relationship Models.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 Strong Entity Patterns: 1:1 Strong Entity Relationships.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE and DAVID J. AUER DATABASE CONCEPTS, 5 th Edition.
Entity-Relationship Model
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming ER Models into Database.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 COS 346 Day 7.
Slide 1 Chapter 05 – Part 1 Data Modeling with the Entity-Relationship Model.
Data Modeling and the Entity-Relationship Model Chapter Four DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
+ Data Modeling (wrapping up from last week). + Homework Review Exercise 4.32 – Develop a data model of a genealogical diagram. Model only biological.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, modified by Dr. Lyn Mathis 5-1 David M. Kroenke’s, 10 th ed. Chapter.
Data Modeling IST210 Class Lecture.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 6-1 David M. Kroenke’s Chapter Six: Transforming Data Models into Database.
Chapter 4 The Semantic Object Model David M. Kroenke Database Processing © 2000 Prentice Hall.
Slide 1 Chapter 05 – Part 2 Data Modeling with the Entity-Relationship Model.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-1 David M. Kroenke’s Chapter Five: Data Modeling with the Entity-Relationship.
David M. Kroenke and David J. Auer Database Processing Fundamentals, Design, and Implementation Chapter Five: Data Modeling with the Entity-Relationship.
CSIS 115 Database Design and Applications for Business Dr. Meg Fryling “Dr. Meg” Fall #csis115 © 2012 Meg Fryling.
Database Design Chapters 17 and 18.
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
Database Processing: David M. Kroenke’s Chapter Five:
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
Requirements Become the E-R Data Model
Database Processing: David M. Kroenke’s Chapter Five:
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
CSIS 115 Database Design and Applications for Business
بسم الله الرحمن الرحيم.
Database Processing: David M. Kroenke’s Chapter Five:
Database Processing: David M. Kroenke’s Chapter Five:
Database Systems: Design, Implementation, and Management Tenth Edition
Database Design Chapters 17 and 18.
Database Processing: David M. Kroenke’s Chapter Six:
Database Processing: David M. Kroenke’s Chapter Five:
Review of Week 1 Database DBMS File systems vs. database systems
Conceptual Data Modeling Using Entities & Relationships
Entities Things about which you need to store data. One entity for each different thing. At least two attributes At least two occurrences Not a property.
Database Processing: David M. Kroenke’s Chapter Five:
Database Processing: David M. Kroenke’s Chapter Five:
Guide to Modeling Keys to E-R diagrams.
Entity Relation Model Tingting Zhang.
Guide to Modeling Keys to E-R diagrams.
Data Modeling and the Entity-Relationship Model
Presentation transcript:

CSIS 115 Database Design and Applications for Business Dr. Meg Fryling “Dr. Meg” Fall 2012 @SienaDrMeg #csis115

Agenda Homework (see next slide) Recursive relationships Review data modeling Finish Hockey League data model Data constraints

Homework Chapter 3 (skip 127-130) Chapter 6 Project – Part II Posted on Blackboard Due Weds, 10/17 by start of class Notice: Next Quiz is Weds, 10/17 May bring a “cheat sheet” 8.5x11, handwritten, both sides, must use your own!

Reminder

Review of New Terms Strong Entities Weak Entities ID-Dependent Strong Entity Patterns 1:1, 1:N, and M:N

Review of New Terms ID-Dependent (Weak) Relationships The Association Pattern Often confused with M:N Really two 1:N relationships (2 parents; 1 child) The Multivalued Pattern Repeating attribute (e.g. phone, address, email) 1:N between strong (parent) and weak (child) entity The Archetype/Instance Pattern Weak entity is a manifestation of its parent (e.g. Class: Section)

Recursive Relationships A recursive relationship occurs when an entity has a relationship to itself. 1:1 1:N N:M KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

Recursive Patterns: 1:1 Recursive Relationship This assumes there is one 1 engine – otherwise, we would need another recursive relationship for the ENGINE entity. The min card on the BOXCAR recursive relationship is optional because the existence of a boxcar ahead and/or a boxcar behind are optional (i.e. there is only 1 boxcar). In addition, the relationship between ENGINE and boxcar is optional in case we just have an ENGINE. We can also have a BOXCAR record with no related ENGINE. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

Recursive Patterns: 1:N Recursive Relationship A manager may manage more than one employee. The relationship is optional to optional because some employees (e.g. the president) have no manager and because some employees manage no one. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

Recursive Patterns: N:M Recursive Relationship KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

Draw an ER Diagram To keep track of students To keep things simple, just keep track of the students’s name and admission term. Some students are mentors of other students All students must have a student mentor Mentors can mentor multiple students

Conceptual Database Design Data Modeling In-Class Activity Open Hockey League Activity Word doc from Blackboard Part 4 Only

Which of the following is considered to be a weak entity? A) ID-dependent entity B) multivalued entity C) association entity D) instance/archetype entity All of them are weak!

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 do I store the information about the price each company is actually charging for the part? This new price is neither an attribute of COMPANY nor is it an attribute of PART! KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

To represent an association pattern in an E-R model, ________. A) create a new ID-dependent entity with a 1:1 relationship to one other entity B) create a new weak, but not ID-dependent entity with a 1:1 relationship to one other entity C) create a new strong entity with a 1:1 relationship to one other entity D) create a new ID-dependent entity with a 1:N relationship to one of two parent entities E) create a new weak, but not ID-dependent entity with a 1:N relationship to one of two parent entities Answer: D) is really the best answer but this really could be accomplished with E) as well.

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? Once we have an attribute that belongs to the relationship not just one of the participating entities, we need a weak entity to store this info. It is no longer a N:M strong entity relationship but an association relationship. This new price is neither an attribute of COMPANY nor is it an attribute of PART! KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

ID-Dependent Relationships: The Association Pattern QUOTATION weak (both PART and COMPANY parent instances must exist first) Identifying relationships (identifiers from PART and COMPANY exist in QUOTATION identifier) COURSE (strong) and STUDENT (strong) ENROLLMENT (weak) with Grade attribute KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

To represent a multivalued attribute in an E-R model, ________. A) create a new ID-dependent entity with a 1:N relationship B) create a new weak, but not ID-dependent entity with a 1:N relationship C) create a new strong entity with a 1:1 relationship D) create a new ID-dependent entity with a 1:1 relationship E) create a new weak, but not ID-dependent entity with a 1:1 relationship Answer: A) is really the best answer but this really could be accomplished with B) as well. Page Ref: 175-177

ID-Dependent Relationships: The Multivalued Attribute Pattern KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

ID-Dependent Relationships: The Multivalued Attribute Pattern Can have multiple multivalued attributes. In this design, phone and contact are independent. Phone number is the phone number of the company and not necessarily a particular contact at that company. We need to change the design if we want the phone number to be associated with a specific company contact. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

ID-Dependent Relationships: Composite Multivalued Attributes We needed to change the design in order to associate each company phone number with a specific company contact. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

To represent an archetype/instance pattern in an E-R model, ________. A) create a new ID-dependent entity with a 1:N relationship B) create a new weak, but not ID-dependent entity with a 1:N relationship C) create a new strong entity with a 1:1 relationship D) create a new ID-dependent entity with a 1:1 relationship E) create a new weak, but not ID-dependent entity with a 1:1 relationship Page Ref: 175-177 Answer: A) is really the best answer but this really could be accomplished with B) as well.

The Archetype/Instance Pattern KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

The Archetype/Instance Pattern Implemented with non-ID-dependent weak entities KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

When an entity has a relationship to itself, we have a(n) ________. A) association relationship B) archetype/instance relationship C) recursive relationship D) multivalued relationship E) None of the above Answer: C

Recursive relationships can have which of the following maximum cardinalities? B) 1:N C) N:M D) A or B E) A, B or C Answer: E Page Ref: 183-185

Recursive Patterns The relationship is optional to optional because some employees (e.g. the president) have no manager and because some employees manage no one. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

Constraints Relationships impose data constraints An employee must have a manager A coach can only coach at most 1 team We have other ways to impose constraints too!

Constraints

Assignments > In-Class Activities > 4 – Data Constraints Let’s look at a hockey league database example and explore its constraints Blackboard Assignments > In-Class Activities > 4 – Data Constraints

Hockey League Relationships