SQL - Table Constraints
You wrote this SQL:
But when you delete a parent row, the child row's
ALTER TABLE child ADD CONSTRAINT fk_parent FOREIGN KEY (parent_id) REFERENCES parent(id) ON DELETE SET NULL;
But when you delete a parent row, the child row's
parent_id does not become NULL. What is the likely problem?