Foreign keys
Multicolumn foreign keys
Updates and deletes


As you can see, the insertion failed. If we provide a value for column manager_id which will be nowhere to be found in column, the database will know something fishy is going on.

How about updating existing columns with incorrect values?


Try to UPDATE the project with id 1 in the table project. Put an incorrect manager_id value, 100 for instance. What do you think will happen this time?

Stuck? Here's a hint!

For example, type:

UPDATE project 
SET manager_id = 100 
WHERE id = 1;