Primary key which is foreign key in an relationship is specified NOT NULL. Why

foreign keyprimary-key

I have question about a foreign key.

Primary key which is foreign key in an relationship is specified NOT NULL in some book's example. Why?

I was thinking that primary key couldn't take on value "null" in an relation. Hence if it is a foreign key in a relationship it couldn't take on value "null" de facto. Otherwise such modification violates key constraints since foreign key has to be one of the values contained in the table it points to in attribute which is primary key.
Thank you very much.

Best Answer

A foreign key null means that there may not be an entry on the other side. In a master-detail relationship it means a detail can exist without a master.

Related Question