Previous Topic: Reverse Engineer Processing Errors

Next Topic: Naming Standards


Inference Table for Reverse Engineer

The following table lists the criteria used to infer primary keys, foreign keys, and relationships in reverse engineering.

Database Item

Inference Rule

Primary Key

If a table includes one index that is defined as unique or primary for that table. Note that the primary key is inferred when the table is imported and created.

Relationship

Infer from Indexes:

If a table includes an index that includes the same index members in the same order as an index identified as a primary key in a different table, and also includes additional columns not found in the primary key.

Infer from Names:

If a table includes an index that has the same name as an index identified as a primary key in a different table.

Parent/Child

After inferring a relationship, it is determined that the larger index (more columns) belongs to the child table and the smaller index (fewer columns) belongs to the parent.

Foreign Key

After inferring a relationship, it is determined that the index members in the child table that match those in the primary key of the parent table comprise the foreign key.

Identifying or Non-Identifying

After inferring a relationship, it is determined that a non-identifying relationship exists if the index columns do not appear in the primary key in the child table and an identifying relationship exists if the index columns do appear in the primary key in the child table.

If you infer primary keys or relationships for a database that already has some of these logical items defined, the software attempts to infer additional information. For example, if the schema contains some primary key information, an attempt is made to infer primary keys for tables where this information is not explicitly defined in the database schema.

Note: In general, the criteria used for inferring primary key and relationship information leads to correct inferences. However, there is no guarantee that these inferences are always correct.