-
Foreign keys cannot contain duplicate data
- Foreign keys must always refer to an indexed column
-
Foreign keys cannot contain null
-
Foreign keys must only ever be numeric
EXPLANATION
In MySQL, a foreign key must always refer to an indexed
column. A foreign key may contain duplicate data or nulls, and can even
be textual in nature.The requirement on indexing is for performance
reasons, and if your table is an InnoDB table, an index may be created
automatically for any foreign key you create, if one does not already
exist.
SOURCE
https://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html
0 comments:
Post a Comment