I do not quite understand what to write in the VALUE field (INSERT commands) for a column with a foreign key property, can you give a simple example?
2 answers
FOREIGN KEY is a restriction, in the field you can enter only the values contained in the base table, or NULL, if the definition of the field allows it.
|
Well FOREIGN KEY, this is really a limitation - a link to another table (parent table). Accordingly, in this column it is possible to indicate only the existing PRIMARY KEY values of the parent table, or NULL (if there are no restrictions on NULL for this field). Read here ...
- but. This is not a relationship (from the point of view of SQL, the concept of communication is generally doubtful, since it does not contain any entity) b. You can limit it not only by the Republic of Kazakhstan (you can look at it both in the link you provided and here ). - Mirdin
|