SQL Foreign Key
11.What would be the behavior of the given code?
DELETE FROM dept WHERE dept_id = 10;
-
A. emp row with dept_id=10 is deleted
-
B. Error: FOREIGN KEY constraint fails
-
C. Deletes both tables
-
D. Sets dept_id = NULL in emp
Error: FOREIGN KEY constraint fails
Error: FOREIGN KEY constraint fails