MySQL foreign key constraints keyword

A primary table (parent table): Table for two tables have a relationship in terms of the field associated with a primary key, i.e., where the primary table.

Table 2 (subtable): For two table having a relationship, the foreign table field associated with the key that is located from the table.

Foreign keys is to establish relationships between multiple tables of data, to ensure consistency, completeness of data between multiple tables. A table may have zero to any number of foreign keys. Referential integrity foreign key belongs, foreign key of a table may be null, if null portions, each foreign key value must be equal to a value of a primary key in another table. After the foreign key is defined, having a data row can not be deleted in another association table.

Guess you like

Origin www.cnblogs.com/zslzmzms/p/11641079.html