Introduction
6. Adding incorrect data - explained
Foreign keys
Multicolumn foreign keys
The insertion succeeded, although we don't have an employee with id 10 in the database. How is it possible that we could add 10 as the value for the column manager_id?
The answer is quite simple. We agreed that the column manager_id will contain a value from the column id in the table employee but that's it. The database doesn't know about that agreement. For our database, it's just another column of integer type, so it can't check whether the values are correct.