Download presentation

Presentation is loading. Please wait.

Published byDavid Madden Modified over 2 years ago

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

2
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
The transformation of an ER or EER model into a 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
The transformation of an ER or EER model into a relational model 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
The transformation of an ER or EER model into a relational model 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
The transformation of an ER or EER model into a relational model 6 ER model relational model binary relationships Activity: how are the participation constraints represented? e.g.: Student No Project Title Supervisor takes 1 0..* Student No Project Title Supervisor takes *

7
The transformation of an ER or EER model into a relational model 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
The transformation of an ER or EER model into a relational model 8 ER model relational model recursive relationships Staff natIns IsManaged * staff manager introduce new entity Staff natIns 1 1 IsAllocatedTo Allocation 0..* 0..1 staff manager HasAllocation

9
The transformation of an ER or EER model into a relational model 9 ER model relational model recursive relationships Activity: what is the difference between (a) and (b)? (a) (b)

10
The transformation of an ER or EER model into a relational model 10 EER model relational model Activity: translate type hierarchies

11
The transformation of an ER or EER model into a relational model 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

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google