e/r model 2 -...

20
E/R Model 2 1 http://users.encs.concordia.ca/~m_oran/

Upload: others

Post on 07-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

E/R Model 2

1

http://users.encs.concordia.ca/~m_oran/

Page 2: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 3: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 4: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

Exercise

Change this E/R diagram so that for every baby

there is a unique mother.

4

Mothers

Babies

Doctors

Nurses births

Page 5: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

Exercise

Change this E/R diagram so that for every baby

there is a unique mother.

5

Mothers

Babies

Doctors

Nurses births

baby-of

Page 6: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which 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

Page 7: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 8: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 9: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 10: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which 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

Page 11: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which 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.

11

Mothers

Babies

Doctors

Nurses

Births

Page 12: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

Exercise

Further change this E/R diagram so that every

baby has a unique mother.

12

Mothers

Babies

Doctors

Nurses

Births

Page 13: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

Exercise

Further change this E/R diagram so that every

baby has a unique mother.

13

Mothers

Babies

Doctors

Nurses

Births

Page 14: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

Exercise

Further change this E/R diagram so that every

baby has a unique mother.

14

Doctors

Babies

Mothers

Nurses

Births

Baby-of

Page 15: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which 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

Page 16: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which 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

Page 17: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which 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

Page 18: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 19: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

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

Page 20: E/R Model 2 - users.encs.concordia.causers.encs.concordia.ca/home/m/moa_ali/Comp353Tutorials/Tutoria… · Exercise A B C D I. a 1 b 1 c 1 d 1 a 1 b 1 c 1 d 2 2 A C B D R Which of

20

http://users.encs.concordia.ca/~m_oran/