One patient has One and only one One physician has more then one patient One patient has One and only one physician One bed max one/0 patient
Stop Here for Today . . .
Generalization and Specialization ____________: The process of defining a higher level more general entity type from a set of more specialized lower-level entity types – a _________ approach, – need supertype, common point ____________ : The process of defining one or more lower-level more specialized subtypes from a higher-level entity supertype – a ________ approach Generalization Specialization bottom-up top-down
Fig. 3-4: Example of Generalization Three vehicle entity types: CAR, TRUCK, and MOTORCYCLE All these types of vehicles have common attributes, which suggests a higher level of supertype.
Fig. 3-4b: Generalization to Supertype So we put the shared attributes in a supertype (called VEHICLE) Note : no subtype for motorcycle, since it has no unique attributes or relationships. No motorcycle as it has no special point
Fig. 3-5a: Example of Specialization Only applies to manufactured parts Only applies to purchased parts Different attributes apply to different part types, which suggests ____________________________.
Fig. 3-5b: Specialization (to MANUFACTURED PART and PURCHASED PART) Note: multi-valued attribute was replaced by a relationship to another entity: Why ? (combination of database design hints #3 and #7) Created 2 subtypes What does this 0 say about suppliers, as defined by this firm?
Constraints: Completeness & Supertype Completeness Constraint question : – Does every instance of a supertype have to be a member of at least one subtype? – If the answer is “ Yes ”: » it is called “________________” » and is indicated by a _________ – If the answer is “ No ”: » it is called “__________________” » and is indicated by a _________ Total specialization double line Partial specialization single line
Fig. 3-6a: Completeness Constraints (“ Total specialization ” rule)
Fig. 3-6b: “Partial Specialization”
Supertype Disjoint/Overlap Constraints Disjointness Constraint question : – Can an instance of a supertype be a member of two (or more) subtypes at the same time? – If the answer is “ Yes ”: » it is called “_______” » and is indicated by an ___ – If the answer is “ No ”: » it is called “_______” » and is indicated by a ___ Overlap “o” Disjoint “d”
( “ Disjoint ” rule) Fig. 3-7: Disjointness Constraint
Fig. 3-7: Disjointness Constraint ( “ Overlap ” rule)
Subtype Discriminators Subtype Discriminator : An _______ of the supertype whose value determines which subtype the new instance will be – for “______”: a simple (single) attribute » whose value indicates the subtype – for “______”: a composite (multi-part) attribute » whose subparts pertain to different subtypes; each subpart is a Boolean value (Y/N) indicating whether or not the instance will belong to that subtype attribute disjoint overlap Yes/no
Fig. 3-8: Subtype Discriminator ( “ Disjoint ” rule) Draw example t
Fig. 3-9: Subtype Discriminator ( “ Overlap ” rule) Draw example t
Fig.3-10: Supertype/Subtype Hierarchy Parse this diagram with respect to completeness and disjointness
- Spring '14
- B MAK
- Object-Oriented Programming, Entity-relationship model