Select the table tool again and place another table on the
canvas. Name this table invoice_item
. Next
click on the 1:n Non-Identifying Relationship
tool.
First click on the invoice_item
table; notice
that a red border indicates that this table is selected. Next
click on the invoice
table. Doing this
creates a foreign key in the invoice_item
table, the table on the “many” side of the
relationship. This relationship between the two tables is shown
graphically in crow's foot notation.
Revert to the default mouse pointer by clicking the arrow at the
top of the vertical toolbar. Click on the
invoice_item
table and select the
Foreign keys tab.
Click in the Foreign key Name text box. The referenced table should show in the Referenced Table column and the appropriate column in the Referenced Column column.
To delete the relationship between two tables, click on the line joining the tables and then press Ctrl Delete.
Experiment with the other tools on the vertical toolbar. Delete a relationship by selecting the eraser tool and clicking on the line joining two tables. Create a view, add a text object, or add a layer.
Save your changes to a MySQL Workbench Models
file (MWB) by choosing Save from the
File menu or by using the keyboard command
Ctrl S.