Post on 03-Jan-2016
description
Database Design & ImplementationWorkshop 4 – Drawing ER Diagrams • Draw Degree, Type & Participation diagrams that
depict each of the following relatively simple ‘real-world’ situations:
– A member of staff must work in a department, and there are many members of staff in each department.
– Several buses can park in the garage, and each bus may cover any number of routes.
– Each producer is in charge of several plays and there are several actors appearing in each play. At any one time an actor may be involved in more than one play.
– An operator can work on many machines and each machine has many operators. Each machine belongs to one department, but a department can have many machines.
A. A member of staff must work in a department, and there are many members of staff in each department.
Department Staff Member
M <=Works
Provides Work Spaces =>
1
Staff Department
1
MWorks in
Staff
B. Several buses can park in the garage, and each bus may cover any number of routes.
Bus/Rou
Route
Bus
Garage
Driver
covers =>
Cov
ered
by
=>
Can acco
mm
odate => Is
par
ked
in=
>
M M
Is p
art o
f =>
<= Driven By
1
Team
1
M
1
1
B. Several buses can park in the garage, and each bus may cover any number of routes.
Garage
Route Bus
M M
M
1
B/R
1 1
1
MM
C. Each producer is in charge of several plays and there are several actors appearing in each play. At any one time an actor may be involved in more than one play.
ProducerHas =>
1
Play Pl/ Ac ActorIn charge=>
<= run by
1 M M M 1
<= Stars in
Actor Act/Play Play
Producer
1 M M 1
1
M<= Has
Acts in =>
Pro
duce
s =
>
<=
Has
C. Each producer is in charge of several plays and there are several actors appearing in each play. At any one time an actor may be involved in more than one play.
ProducerHas =>
1
Play Pl/ Ac ActorIn charge=>
<= run by
1 M M M 1
<= Stars in
Actor Act/Play Play
Producer
1 M M 1
1
M<= Has
Acts in =>
Pro
duce
s =
>
<=
Has
Operator
Op/Ma
Department
Machine
has =>
Bel
ongs
to =
>
<=
wor
ks o
n
11
1M
M M<= used by
D. An operator can work on many machines and each machine has many operators. Each machine belongs to one department, but a department can have many machines.
D. An operator can work on many machines and each machine has many operators. Each machine belongs to one department, but a department can have many machines.
Ope
Ope+Mac
Mac
Dep
1
M
M
M M
M
1
1