Introduction
Foreign keys
Multicolumn foreign keys
Updates and deletes
19. Updating rows with foreign keys
Revision

Instruction

Perfect! This was no challenge for you!

What happens when we change the data in the main table while there are some foreign keys involved? We've seen it already - the database won't let us do that.

Exercise

Let's check that once again. Try to take the employee with id = 1 from the table employee and change the id to 107.

Stuck? Here's a hint!

Type

UPDATE employee SET id = 107 WHERE id = 1;

Console

Code editor

Result

TableConsole