04 Try it yourself Interactive
The same seven statements against the same two tables, with one word changed in CREATE TABLE. Pick the referential action, then step through: a child row is inserted pointing at a department that does not exist, the same row is inserted pointing at one that does, and then the department two employees belong to is deleted. The last two steps start again with dept_id declared NOT NULL and run the delete once more, which is where SET NULL comes apart. Nothing plays on its own: Next, Back and Reset, or the arrow keys.