Emp.dept_id is a foreign key to Dept(id) and is not declared NOT NULL. What happens when you insert an Emp row with dept_id set to NULL?
Correct answer B. The insert succeeds, because a NULL foreign key is not checked
Explanation
Referential integrity requires a foreign key value either to match an existing referenced key or to be NULL. A NULL foreign key means the relationship is unknown or absent, so the constraint is not violated and the insert succeeds. If every employee must belong to a department, add NOT NULL to dept_id as well. The DBMS never invents parent rows.
Answer checked How we write and check questions
Discussion