Download presentation
Presentation is loading. Please wait.
Published bySamantha Warner Modified over 9 years ago
1
COOP-1 CARDINALITIES SOLUTION PACKAGE
2
Problem #2 Group _______ Problem #2 Group _______ Problem #1 Person MinMaxMinMax has_as_favorite Jimmy (a person) doesn’t care about music and does not have a favorite musician (We still need to record Jimmy in our database). Only one favorite musician can be recorded for a person. We have recorded more than thousand musicians in our database Many people have Neil Young as their favorite musician Unfortunately, no one has selected Freddy Fender (one of the musicians in our database) as their favorite musician. Musician
3
Problem #2 Group _______ Problem #2Problem #1 -- Solution Person 0 Min 1 Max 0 Min N Max has_as_favorite Jimmy (a person) doesn’t care about music and does not have a favorite musician (We still need to record Jimmy in our database). Only one favorite musician can be recorded for a person. We have recorded more than thousand musicians in our database Many people have Neil Young as their favorite musician Unfortunately, no one has selected Freddy Fender (one of the musicians in our database) as their favorite musician. Musician
4
ParentChild Group _______ Problem #2 MinMaxMinMax
5
ParentChild Problem #2 1. Being a parent implies that you have one or more children. 2. All children have 2 parents.
6
ParentChild Problem #2 -- Solution 1 Min N Max 1 Min N Max 1.Being a parent implies that you have one or more children. 2. All children have 2 parents.
7
CarOrder Sale (shipment) Purchase (Deliver) Min Max Min Group _______ Problem #3 1.We always have open orders – i.e., orders that have not been fulfilled yet. 2. A car can only be sold once. 3. We have some cars in inventory – i.e., cars we have bought (purchased) but that have not been sold yet. 4. We buy cars exclusively – i.e., at least one car needs to be recorded for each purchase.
8
CarOrder Sale (shipment) Purchase (Deliver) 0 Min 1 Max 1.We always have open orders – i.e., orders that have not been fulfilled yet. 2. A car can only be sold once. 3. We have some cars in inventory – i.e., cars we have bought (purchased) but that have not been sold yet. 4. We buy cars exclusively – i.e., at least one car needs to be recorded for each purchase. 0 Min 1 Problem #3 -- Solution
9
Group _______ Problem #5 Purchase/ Delivery Cash Disbursement Group _______ Problem #4 -- Assignment MaxMinMaxMin Labor Service Here are our payment policies: 1.We usually pay our vendors no later than 60 days after delivery. 2.We often pay our vendors in installments. 3.Some of our cash disbursements (checks) pay for deliveries (by vendors). Some of our cash disbursements (checks) pay for labor services (by employees). 4.The same cash disbursement can pay for multiple deliveries.
10
Group _______ Problem #5 Purchase/ Delivery Cash Disbursement Here are our payment policies: 1.We usually pay our vendors no later than 60 days after delivery. 2.We often pay our vendors in installments. 3.Some of our cash disbursements (checks) pay for deliveries (by vendors). Some of our cash disbursements (checks) pay for labor services (by employees). 4.The same cash disbursement can pay for multiple deliveries. Problem #4 -- Solution N Max 0 Min N Max 0 Min Labor Service
11
Monica owes a store that sells stuffed animals. She records all her customers and items (stuffed animals) in a database. She currently has more than 350 customers; all of them are recorded in the database. She currently sells 486 different items; all of them are recorded in the database. Further, for her 25 most important customers (“Club 25”) she keeps a list of their 5 favorite items. She uses that information to send gifts (birthday, wedding, etc.). An item can be the favorite item for more than one “Club 25” member. CustomerItem MinMaxMinMax Club 25 Group _______ Problem #5
12
Problem #5 – Solution Monica has a store that sells stuffed animals. She records all her customers and items (stuffed animals) in a database. She currently has more than 350 customers; all of them are recorded in the database. She currently sells 486 different items; all of them are recorded in the database. Further, for her 25 most important customers (“Club 25”) she keeps a list of their 5 favorite items. She uses that information to send gifts (birthday, wedding, etc.). An item can be the favorite item for more than one “Club 25” member. CustomerItem 0 Min N Max 0 Min N Max Club 25
13
Group _______ Problem #8 Some employees supervise projects exclusively; i.e. they don’t work on any project. Most of our employees do not supervise projects; i.e. they only work on projects. John, one of our employees, currently works on five different projects. Suzy, one of our employees, currently supervises two different projects. A project is supervised by one employee. We currently have more than twenty employees working on one of our projects. We always assign the supervisor first. So it is possible to record a project’s supervisor in the database without knowing who (employees) is going to work on the project. It is impossible to record a project into our database without recording a supervisor at the same time; i.e., a project must have a supervisor. Group _______ Problem #6 Define the cardinalities PROJECT works-on supervises MIN MAX MIN MAX MIN EMPLOYEE
14
Group _______ Problem #8 Some employees supervise projects exclusively; i.e. they don’t work on any project. Most of our employees do not supervise projects; i.e. they only work on projects. John, one of our employees, currently works on five different projects. Suzy, one of our employees, currently supervises two different projects. A project is supervised by one employee. We currently have more than twenty employees working on one of our projects. We always assign the supervisor first. So it is possible to record a project’s supervisor in the database without knowing who (employees) is going to work on the project. It is impossible to record a project into our database without recording a supervisor at the same time; i.e., a project must have a supervisor. Problem #6 -- Solution Define the cardinalities PROJECT works-on supervises N 0 MIN MAX 0 N MIN MAX N 0 1 1 MIN EMPLOYEE
15
Some of our locations, such as our warehouses, are further divided. For example, a warehouse is divided in areas, and each area is then further divided into bins. One of our warehouses is divided into twenty areas. Bins are never further divided. A location belongs to at most one other location. Obviously, warehouses do not belong to any other location. Warehouse, area, and bin are all instances of location. Problem #7 -- Assignment Location MaxMinMaxMin
16
Problem #7 -- Assignment With Role Names Location DIVIDED INBELONGS TO Some of our locations, such as our warehouses, are further divided. For example, a warehouse is divided in areas, and each area is then further divided into bins. One of our warehouses is divided into twenty areas. Bins are never further divided. A location belongs to at most one other location. Obviously, warehouses do not belong to any other location. Warehouse, area, and bin are all instances of location. MaxMinMaxMin
17
Problem #7 -- Solution Location DIVIDED INBELONGS TO Some of our locations, such as our warehouses, are further divided. For example, a warehouse is divided in areas, and each area is then further divided into bins. One of our warehouses is divided into twenty areas. Bins are never further divided. A location belongs to at most one other location. Obviously, warehouses do not belong to any other location. Warehouse, area, and bin are all instances of location. N Max 0 Min 1 Max 0 Min
18
WAREHOUSE-1 AREA-1A AREA-1B BIN-1AABIN-1ABBIN-1AC BIN-1BABIN-1BB WAREHOUSE-1 AREA-1AAREA-1B BIN-1AA BIN-1AB BIN-1AC BIN-1BA BIN-1BB DIVIDED-IN BELONGS-TO
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.