Presentation on theme: "The transformation of an ER or EER model into a relational model"— Presentation transcript:
1 The transformation of an ER or EER model into a relational model
2 Transforming an ER model into a relational model ER model - not supported directly by any DBMSneeds to be translated into a model that is supported by DBMSstransformation / mapping processnon-deterministiccertain ER configurations can be expressed in more than one way in the relational modelcertain aspects related to the relational model are not specified in the ER modeltransformation guidelines (rules)some approaches propose two phasesER model to translatable ER model (this can be optional/implicit)translatable ER model into relational model
3 ER model relational model entities strong entity base relationsimple, single valued base attributes - okcomposite - flattenmulti-valued - introduce entity and link with 1:M relationshipcalculated attributes - eliminateweak entity base relationprimary key contains part of the strong entity primary keyforeign key referencing the base relation corresponding to the strong entityhow is the “weak entity” information modelled in the relational model?cannot have SET NULL or SET DEFAULT
4 ER model relational model binary relationships one to oneone partial and one total participation foreign key from the base relation corresponding to the entity with partial participation to the one with total participationtwo partial participations one foreign key from one base relation to anothertwo total participations as above or mergewhy would you want to keep them separate?one to manyFK from the “many entity” relationship to the “one entity” relationshipdoes it matter whether the “many entity” is weak or strong?
5 ER model relational model binary relationships many to manyno attributesrelationship relation consisting of two foreign keys, one for each relation corresponding to the two entities involvedthe two foreign keys primary keyalternatively, change the ER modelwith attributestransform relationship into entityimplement the two resulting 1:M relationships
6 ER model relational model binary relationships Activity: how are the participation constraints represented? e.g.:StudentStudentNoNo10..1takestakes0..*1..*ProjectProjectTitleSupervisorTitleSupervisor
7 ER model relational model complex relationships with attributestransform into entityno attributesrelationship relation consisting of foreign keys, one for each relation corresponding to the entities involvedalternatively, transform complex relationship into binary relationships
8 ER model relational model recursive relationships introduce new entityStaffstaffStaffstaffmanagermanager0..*0..111natInsnatInsIsAllocatedToHasAllocationAllocation0..1IsManaged0..*
9 ER model relational model recursive relationships Activity: what is the difference between (a) and (b)?(a)(b)
10 EER model relational model Activity: translate type hierarchies
11 Conclusion conceptual model logical model is the resulting logical model the model that is going to be implemented?logical design expressing further constraints on datafunctional dependenciesmulti-valued dependenciesjoin dependenciesif they are not correctly expressed - the logical model can lead to update anomalies
Your consent to our cookies if you continue to use this website.