To create a reference between tables: 1. Click the Reference () item on the Main tab of Ribbon. Your mouse cursor will change its appearance. 2. Click on the table (referencing table or child table) that will have a foreign key. 3. Then click on the second table (referenced table or parent table) whose constraint (e.g. primary key) will be referenced by the new foreign key. 4. The Joins tab of the Reference Editor will be shown. You can choose columns of a referenced (parent) and referencing (child) table participated in the reference. The properties of auto column will be copied from the respective column of the referenced table. Please note: Please note: Reference Creation in Detail On reference creation, Database Designer for MySQL performs the following actions: 1. Creates new column(s) in the referencing table, their parameters (name, data type) will be copied from the primary key constraint of the referenced table. If the referencing table already has column(s) analogous to the primary key(s) of the referenced table, this column(s) will be used as foreign-key column(s). 2. If there is no primary key or unique constraints in the referenced table, a standard primary key column will be created in the referenced table. 3. Creates foreign key constraint in the referencing table that refers to the referenced table primary key(s). Please note: See the Diagram Display Preferences topic to find out more about default References options, actions, etc. See the Notation topic to find out more about reference symbol on the diagram. See also: |