"Physical to Logical" Synchronization Rules
Synchronizing the logical model from the physical model enables creation of the database data diagram from its tables.
Rules used for this transformation are:
- A table of which the primary key is composed of a foreign key relating to the same columns becomes an entity. A generalization is created between this entity and the entity corresponding to the table to which the foreign key is pointed.
Physical level example:
Result at the logical level:
- A table of which the primary key is composed of foreign keys only becomes an association of multiplicities (*..*). If columns do not belong to the primary key, an attribute connected to the association will be created for each of these columns.
Physical level example:
Result at the logical level:
- A table of which the primary key contains foreign keys and at least one column that is not a foreign key becomes an entity. An aggregated association is created between this entity and the entity corresponding to the table to which each of the foreign keys is pointed.
The candidate key of the entity is composed of the roles of aggregated associations and of the attribute(s) corresponding to the other columns of the primary key of the table.
Physical level example:
Logical level result:
- A table of which the primary key is composed of foreign keys only pointing to the same table becomes a reflexive association of multiplicities (*..*).
Physical level example:
Logical level result:
- In other cases, each table becomes an entity and its columns the attributes of the entity.
- A foreign key becomes an association (0..1, *). If all the columns of the key are mandatory, its cardinalities become (1, *).
- Types of attributes are recalculated with the help of the conversion table specific to the target DBMS (see Data Types and Column Datatypes).