"Bruce Lewis" <brlspam (AT) yahoo (DOT) com> wrote
Quote:
net__space (AT) hotmail (DOT) com (Andy) writes:
General statement: FK should not be nullabe to avoid orphans in DB.
I don't see the reasoning behind this statement. Any column that
references keys to another table should be explicitly specified as such
to avoid orphans.
If that column may sometimes be unknown/unspecified for perfectly valid
records, I see no reason not to make it nullable.
snip
|
I agree. In fact, I am working on a system right now where we have this case
exactly. We have invoices that may or may not be associated with a contract.
We have FK for the contract number in the invoice table (over simplified for
sake of argument) and it must be, by definition, nullable because business
rules allow for it.
--
BV.
WebPorgmaster - www.IHeartMyPond.com
Work at Home, Save the Environment - www.amothersdream.com