Download - Modern Database Management 7th Edition, Chapter 4

Transcript

©© 2005 by Prentice Hall 2005 by Prentice Hall 11

Modern Database ManagementModern Database Management77thth Edition, Chapter 4 Edition, Chapter 4

Jeffrey A. Hoffer, Mary B. Prescott,Jeffrey A. Hoffer, Mary B. Prescott,Fred R. McFaddenFred R. McFadden

Slides edited by Rasmus PaghSlides edited by Rasmus Pagh

22Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

33Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-2 – Employee supertype with three subtypes

All employee subtypeswill have emp nbr, name,address, and date-hired

Each employee subtypewill also have its ownattributes

44Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-3 – Supertype/subtype relationships in a hospital

Both outpatients andresident patients arecared for by aresponsible physician

Only resident patients areassigned to a bed

55Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-6a – Examples of completeness constraints

Total specialization rule

A patient must be eitheran outpatient or aresident patient

66Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-6b – Partial specialization rule

A vehicle could be acar, a truck, or neither

77Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Disjoint rule

Figure 4-7a – Examples of disjointness constraints

A patient can either be outpatientor resident, but not both

88Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-7b Overlap rule

A part may beboth purchasedand manufactured

99Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-8 – Introducing a subtype discriminator (disjoint rule)

A simple attribute withdifferent possible valuesindicating the subtype

1010Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-9 – Subtype discriminator (overlap rule)

A composite attributewith sub-attributesindicating “yes” or “no”to determine whether itis of each subtype

1111Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

1212Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-13a – Possibleentity clusters for Pine

Valley Furniture

Relatedgroups ofentities couldbecomeclusters

1313Chapter 4 ©© 2005 by Prentice Hall 2005 by Prentice Hall

Figure 4-13b – EER diagram of PVF entity clusters

More readable,isn’t it?