Seven: Table Relationships

Table 1. Relationship

Many: adding a foreign key in a multi-table

One: add foreign key, and foreign keys + unique guarantee will not be repeated, adding the foreign key table after appearing, such as students and instructors, first determine the admission list, and then have the students choose to mentor, to determine the relationship, the relationship table add foreign key

Many-: adding an intermediate table, the intermediate table two foreign keys, respectively, and two multi-table id associating.

The table does not rely on foreign key to contact, but by your own understanding of the business logic layer placed to achieve,

Guess you like

Origin www.cnblogs.com/gyxpy/p/11571643.html