Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSIS 115 Database Design and Applications for Business

Similar presentations


Presentation on theme: "CSIS 115 Database Design and Applications for Business"— Presentation transcript:

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

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

3 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!

4 Reminder

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

6 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, ) 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)

7 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

8 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

9 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

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

11 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

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

13 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!

14 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

15 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.

16 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

17 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

18 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:

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

20 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

21 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

22 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: Answer: A) is really the best answer but this really could be accomplished with B) as well.

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

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

25 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

26 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:

27 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

28 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!

29 Constraints

30 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

31 Hockey League Relationships


Download ppt "CSIS 115 Database Design and Applications for Business"

Similar presentations


Ads by Google