Presentation is loading. Please wait.

Presentation is loading. Please wait.

The transformation of an ER or EER model into a relational model

Similar presentations


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 DBMS needs to be translated into a model that is supported by DBMSs transformation / mapping process non-deterministic certain ER configurations can be expressed in more than one way in the relational model certain aspects related to the relational model are not specified in the ER model transformation guidelines (rules) some approaches propose two phases ER 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 relation simple, single valued base attributes - ok composite - flatten multi-valued - introduce entity and link with 1:M relationship calculated attributes - eliminate weak entity  base relation primary key contains part of the strong entity primary key foreign key referencing the base relation corresponding to the strong entity how 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 one one partial and one total participation  foreign key from the base relation corresponding to the entity with partial participation to the one with total participation two partial participations  one foreign key from one base relation to another two total participations  as above or merge why would you want to keep them separate? one to many FK from the “many entity” relationship to the “one entity” relationship does it matter whether the “many entity” is weak or strong?

5 ER model  relational model binary relationships
many to many no attributes relationship  relation consisting of two foreign keys, one for each relation corresponding to the two entities involved the two foreign keys  primary key alternatively, change the ER model with attributes transform relationship into entity implement the two resulting 1:M relationships

6 ER model  relational model binary relationships
Activity: how are the participation constraints represented? e.g.: Student Student No No 1 0..1 takes takes 0..* 1..* Project Project Title Supervisor Title Supervisor

7 ER model  relational model complex relationships
with attributes transform into entity no attributes relationship  relation consisting of foreign keys, one for each relation corresponding to the entities involved alternatively, transform complex relationship into binary relationships

8 ER model  relational model recursive relationships
introduce new entity Staff staff Staff staff manager manager 0..* 0..1 1 1 natIns natIns IsAllocatedTo HasAllocation Allocation 0..1 IsManaged 0..*

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 data functional dependencies multi-valued dependencies join dependencies if they are not correctly expressed - the logical model can lead to update anomalies


Download ppt "The transformation of an ER or EER model into a relational model"

Similar presentations


Ads by Google