COOP-1 CARDINALITIES
SOLUTIONPACKAGE
Problem #2 Group _______Problem #2 Group _______Problem #1
Person
Min Max Min 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
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
Parent Child
Group _______Problem #2
Min Max Min Max
Parent Child
Problem #2
1. Being a parent implies that you have one or more children.2. All children have 2 parents.
Parent Child
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.
Car Order
Sale(shipment)
Purchase(Deliver)
Min
Max
Min
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.
Car Order
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
Min
Problem #3 -- Solution
Group _______Problem #5
Purchase/Delivery
CashDisbursement
Group _______Problem #4 -- Assignment Max Min MaxMin
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.
Group _______Problem #5
Purchase/Delivery
CashDisbursement
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
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.
Customer Item
Min Max Min Max
Club 25
Group _______Problem #5
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.
Customer Item
0
Min
N
Max
0
Min
N
Max
Club 25
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 #6Define the cardinalities
PROJECT
works-on
supervises
MIN
MAX
MAX
MIN
MIN
MAX
MAX
MIN
EMPLOYEE
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 -- SolutionDefine the cardinalities
PROJECT
works-on
supervises
N
0MIN
MAX
0
NMAX
MIN
MIN
MAXN
0
1
1 MAX
MIN
EMPLOYEE
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
MaxMin MaxMin
Problem #7 -- Assignment With Role Names
Location
DIVIDED IN BELONGS 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.
MaxMin MaxMin
Problem #7 -- Solution
Location
DIVIDED IN BELONGS 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
WAREHOUSE-1
AREA-1A
AREA-1B
BIN-1AA BIN-1AB BIN-1AC
BIN-1BA BIN-1BB
WAREHOUSE-1
AREA-1A AREA-1B
BIN-1AA
BIN-1AB
BIN-1AC
BIN-1BA
BIN-1BB
DIV
IDE
D-I
N
BE
LO
NG
S-T
O