Database Design by
ER- and EER-to-Relational
This chapter discusses how to design
a relational database schema based
on a conceptual schema design.
Figure 7.1 presented a high-level view of the database design process, and in
this chapter we focus on the logical database design or data model mapping step
of database design. We present the procedures to create a relational schema
from an Entity-Relationship (ER) or an Enhanced ER (EER) schema. Our discussion
relates the constructs of the ER and EER models, presented in Chapters 7 and 8,
to the con-structs of the relational model, presented in Chapters 3 through 6.
Many computer-aided software engineering (CASE) tools are based on the ER or
EER models, or other similar models, as we have discussed in Chapters 7 and 8.
Many tools use ER or EER diagrams or variations to develop the schema
graphically, and then convert it automatically into a relational database
schema in the DDL of a specific relational DBMS by employing algorithms similar
to the ones presented in this chapter.
We outline a seven-step algorithm in Section 9.1 to convert the basic ER
model con-structs—entity types (strong and weak), binary relationships (with
various structural constraints), n-ary
relationships, and attributes (simple, composite, and multivalued)—into
relations. Then, in Section 9.2, we continue the mapping algorithm by
describing how to map EER model constructs—specialization/generalization and
union types (categories)—into relations. Section 9.3 summarizes the chapter.