Logical Mapping
- Represent entities as a new table
- Represent attributes as columns in the table
- Represent relationships either as column in existing table or table of its own
For Entities: It contains its primary key (underlined)
A weak entity sets must include:
- attributes of weak entity set
- attributes of identifying relationship set
- primary key attributes of dominating entity set also include its own key and the primary key attributes of entity set for dominating entities, as well as its own weak attributes.
For Relationship sets: A relationship set may map to either new table columns for existing tables of entity sets or to a new table.
For Aggregation: Treat it as an entity set whose primary key is same as R’s table
- always map relationship set R that’s aggregated to a new table R
For Specialization: Treat an entity set which is a specialization of one or more entity sets as a weak entity set with an empty discriminator set and that is existence dependent on each of the other entity sets. In this case, Student is the specialization or Graduate?
For Generalization: Treat a generalization of entities sets as specializations, and add additional constraints for coverage and if required disjointness.
- contains a reference to Vehicle’s primary key as a foreign key in both Truck and Car tables.
Views
Entity sets can be mapped to view instead of a table when entity set is a specialization of 1 parent set
in addition:
- only typing attributes are declared on
- no foreign key constraints ref
- all entity sets that are specializations of are also mapped to views
Multiple typing attributes can be replaced with a single typing attribute when underlying entity sets are disjoint.