Foreign Key Mysql Workbench
How to create a second table and foreign key relationship using the mysql workbench tool.
Foreign key mysql workbench. This creates a foreign key in the invoice item table the table on the many side of the relationship. The film and the. First click the invoice item table. Name this table invoice item next click the 1 n non identifying relationship tool.
To add a foreign key using the table editor see. This section deals with adding a foreign key using the foreign key tools. Notice that a red border indicates that this table is selected. To edit the properties of a foreign key double click anywhere on the connection line that joins the two tables.
Using mysql workbench you may add a foreign key from within the table editor or by using the relationship tools on the vertical toolbar of an eer diagram. Select the table tool again and place another table on the canvas. Next click the invoice table. Figure 8 16 the foreign keys tab.
Mysql workbench manual. Pausing your mouse pointer over a relationship connector highlights the connector and the related keys as shown in the following figure. For more information see foreign key constraint differences. The foreign keys subtab is organized in much the same fashion as the indexes subtab and adding or editing a foreign key is similar to adding or editing an index.