Can table columns with a Foreign Key be NULL?

I have a table which has several ID columns to other tables.

I want a foreign key to force integrity only if I put data in there. If I do an update at a later time to populate that column, then it should also check the constraint.

(This is likely database server dependant, I’m using MySQL & InnoDB table type)

I believe this is a reasonable expectation, but correct me if I am wrong.

7 Answers
7

Leave a Comment