ER and EER To Relational Model Mapping
ER and EER To Relational Model Mapping
Lecture Content:
Learning Outcomes:
After conceptual database design, the next step is selecting a DBMS for implementation.
The conceptual design is converted into a database schema in the chosen DBMS's data
model.
Before 1970, hierarchical and network models were used.
The relational model (introduced by Codd in 1970) is now widely used.
Relational Model
Integrity Constraints
Domain Constraints: Values in a column must be valid according to their defined type.
Key Constraints:
A candidate key uniquely identifies tuples.
One primary key is chosen.
Referential Integrity:
Ensures foreign keys reference existing tuples in another relation.
Prevents inconsistent data.
Other Constraints:
Table constraints (e.g., account balance > 0 using CHECK in SQL).
Assertions (cross-table constraints, e.g., employee salary cannot exceed manager's
salary).
Mapping Entities & Attributes: Convert entity attributes into relational schema.
Mapping Relationships:
Binary relationships mapped via foreign keys.
N-ary relationships require a separate relation.
Mapping ISA Relationships:
Option 1: Superclass relation + separate subclass relations.
Option 2: Only subclass relations, including superclass attributes.
Option 3: Single relation with all attributes and a type column.
Option 4: Single relation with Boolean subclass indicators.
Mapping Aggregation Relationships: Convert aggregation into relational tables, ensuring
key consistency.
Activities