e/r model 2 -...
TRANSCRIPT
E/R Model 2
1
http://users.encs.concordia.ca/~m_oran/
Exercise
A B C D I. a1 b1 c1 d1
a1 b1 c1 d2
2
A
C
B
D
R
Which of one could not be the relationship set for the E/R diagram?
A B C D III. a1 b1 c1 d1
a1 b2 c1 d1
A B C D II. a1 b1 c1 d1
a1 b1 c2 d2
Exercise
3
A
C
B
R
If A has 5 entities , B has 10 entities and C has 20 entities what is
the maximum number of entities (A,B,C) that could be in the
relationship set R?
1. 100
2. 5
3. 50
4. 1000
Exercise
Change this E/R diagram so that for every baby
there is a unique mother.
4
Mothers
Babies
Doctors
Nurses births
Exercise
Change this E/R diagram so that for every baby
there is a unique mother.
5
Mothers
Babies
Doctors
Nurses births
baby-of
Exercise
Change this E/R diagram so that for every
combination of baby, Nurse, and doctor there is a
unique mother.
6
Mothers
Babies
Doctors
Nurses births
Exercise
Change this E/R diagram so that for every
combination of baby, Nurse, and doctor there is a
unique mother.
7
Mothers
Babies
Doctors
Nurses births
Exercise
Change this E/R diagram so that for every
combination of a baby and a mother, there is at
most one doctor.
8
Mothers
Babies
Doctors
Nurses births
Exercise
Change this E/R diagram so that for every
combination of a baby and a mother, there is at
most one doctor.
9
Mothers
Babies
Doctors
Nurses births
Doctor-of
Exercise
Change this E/R diagram so that every baby is
the result of a unique birth and every birth is of
a unique baby.
10
Mothers
Babies
Doctors
Nurses
Births
Exercise
Change this E/R diagram so that every baby is
the result of a unique birth and every birth is of
a unique baby.
11
Mothers
Babies
Doctors
Nurses
Births
Exercise
Further change this E/R diagram so that every
baby has a unique mother.
12
Mothers
Babies
Doctors
Nurses
Births
Exercise
Further change this E/R diagram so that every
baby has a unique mother.
13
Mothers
Babies
Doctors
Nurses
Births
Exercise
Further change this E/R diagram so that every
baby has a unique mother.
14
Doctors
Babies
Mothers
Nurses
Births
Baby-of
Exercise
Further change this E/R diagram so that for
every birth there is a unique doctor.
15
Doctors
Babies
Mothers
Nurses
Births
Baby-of
Exercise
Further change this E/R diagram so that for
every birth there is a unique doctor.
16
Doctors
Babies
Mothers
Nurses
Births
Baby-of
Exercise
Which one says: “a student (e.g. Mahsa ) can borrow a book (e.g. Databases)
several times” ?
17
Students
name
address
phone ID
Books
name
year
location
availability
Borrowing date
Returning date
Students
name
address
phone ID
Books
name
year
location
availability
Borrowing date
Returning date
1
2
Exercise
Change your design so that the relationship
borrows does not have any attribute.
18
Students
name
address
phone ID
Books
name
year
location
availability
Borrowing date
Returning date
Exercise
Change your design so that the relationship
borrows does not have any attribute.
19
Students
name
address
phone ID
Books
name
year
location
availability
Borrowing date
Returning date
20
http://users.encs.concordia.ca/~m_oran/