CH 09
CH 09
Chapter 9 Outline
!! Relational Database Design Using ER-toRelational Mapping !! Mapping EER Model Constructs to Relations
!! Seven-step algorithm to convert the basic ER model constructs into relations !! Additional steps for EER model
Assume that the mapping will create tables with simple single-valued attributes For each regular entity type, create a relation R that includes all the simple attributes of E Called entity relations
! Each tuple represents an entity instance
!!
For each weak entity type, create a relation R and include all simple attributes of the entity type as attributes of R Include primary key attribute of owner as foreign key attributes of R
!!
Possible approaches:
! Foreign key approach ! Merged relationship approach ! Crossreference or relationship relation approach
Alternative approach
! Use the relationship relation (cross-reference) option as in the third option for binary 1:1 relationships
Represented by having two attributes A and B: one a primary key and the other a foreign key
!!
!!
Summary
!! Map conceptual schema design in the ER model to a relational database schema
!! !!
Algorithm for ER-to-relational mapping Illustrated by examples from the COMPANY database
!! Include additional steps in the algorithm for mapping constructs from EER model into relational model