GegevensAnalyse Les 2: Bouwstenen en bouwen
CUSTOMER: The Entity Class and Two Entity Instances
Attributes Attributes describe an entity’s characteristics. All entity instances of a given entity class have the same attributes, but vary in the values of those attributes. Originally shown in data models as ellipses. Data modeling products today commonly show attributes in rectangular form.
Binary Relationship
The Three Types of Maximum Cardinality
The Three Types of Minimum Cardinality
ID-Dependent Entities An ID-dependent entity is an entity (child) whose identifier includes the identifier of another entity (parent). The ID-dependent entity is a logical extension or sub-unit of the parent: –BUILDING : APARTMENT –PAINTING : PRINT The minimum cardinality from the ID-dependent entity to the parent is always one.
ID-Dependent Entities A solid line indicates an identifying relationship
Weak Entities A weak entity is an entity whose exisitence depends upon another entity. All ID-Dependent entities are considered weak. But there are also non-ID-dependent weak entities. –The identifier of the parent does not appear in the identifier of the weak child entity.
Weak Entities (Continued) A dashed line indicates a nonidentifying relationship Weak entities must be indicated by an accompanying text box in Erwin – There is no specific notation for a nonidentifying but weak entity relationship
ID-Dependent and Weak Entities
Subtype Entities A subtype entity is a special case of a supertype entity: –STUDENT : UNDERGRADUATE or GRADUATE The supertype contains all common attributes, while the subtypes contain specific attributes. The supertype may have a discriminator attribute that indicates the subtype.
Subtypes with a Discriminator
Subtypes: Exclusive or Inclusive If subtypes are exclusive, one supertype relates to at most one subtype. If subtypes are inclusive, one supertype can relate to one or more subtypes.
Subtypes: Exclusive or Inclusive (Continued)
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 5-16 Subtypes: IS-A relationships Relationships connecting supertypes and subtypes are called IS-A relationships, because a subtype IS A supertype. The identifer of the supertype and all of its subtypes must be identical, i.e., the identifier of the supertype becomes the identifier of the related subtype(s). Subtypes are used to avoid value- inappropriate nulls.
HAS-A Relationships The relationships we have been discussing are known as HAS-A relationships: –Each entity instance has a relationship with another entity instance: An EMPLOYEE has one or more COMPUTERs. A COMPUTER has an assigned EMPLOYEE.
Recursieve relaties Kunnen meerdere dokters andere dokters bedokteren? Kan een student een student begeleiden? Kan een student meerdere studenten begeleiden? In deze relaties zit de sleutel van de tabel als vreemde sleutel in dezelfde tabel
Stappenplan “W”→ERD Benoem elk ZNW Hergroepeer de ZNW (=elementen) Is er overlap in elementen? Benoem de groepen (entiteiten) De elementen zijn attributen Stel “use cases” op Ga mbv.UC de relaties opstellen Bepaal (op recordniveau) de relaties (cardinaliteiten.
Stappenplan vervolg: Ga op zoek naar bekende patronen!!! Ga op zoek naar patronen die je al kent!! Gebruik je kennis van patronen op nieuwe situaties!!! Enz…