Re: Can FK be nullable/optional by design?

From: Eric Junkermann <>
Date: 10 Dec 2003 05:04:55 -0800
Message-ID: <> (Andy) wrote in message news:<>...
> Hi All!
> General statement: FK should not be nullabe to avoid orphans in DB.

Where did this statement come from? The idea of an orphan belongs to network and hierarchical databases (old fashioned) or to object-oriented databases (allegedly new), where the only way to get to a record might be through its parent record. In a relational database there is no such thing as an orphan.

You can find your "orphans" by some equivalent of (client where groupcode not present) (worded that way to keep away from arguments about NULLS).

In your example, what you have is

  A client may be a member of at most one group.

If you meant to have

  A client must be a member of exactly one group.

then (in your example) you would have to use NOT NULL.


Eric Received on Wed Dec 10 2003 - 14:04:55 CET

Original text of this message