Converting ER diagrams to relational models (table schemas)
One-one relationship
Model each
entity as a separate relation. Add the primary key of one relation as a foreign
key (a copy of the primary key from the first relation which may or may not be
a part of the primary key) to the other relation.
The above ER
diagram can be modeled as a relational model or table schemas as follows:
Department:
name |
budget | secretary | famName | givenName
pk fk
(primary key) (foreign key)
Employee:
famName
| givenName | address | salary
pk
(primary key)
No comments:
Post a Comment