Re: DB required to list multiple D.I.V.O.R.C.E.S. & Re-marriages
From: Paul Linehan <paul_at_not.a.chance.ie>
Date: Sun, 23 Dec 2001 15:31:56 GMT
Message-ID: <3c25f8c4.2867473_at_news.tcd.ie>
Date: Sun, 23 Dec 2001 15:31:56 GMT
Message-ID: <3c25f8c4.2867473_at_news.tcd.ie>
71062.1056_at_compuserve.com (--CELKO--) wrote:
> >> With many couple getting Divorced and re-married should I have multiple
> cross referenced columns? <<
> What you want to track is marriages, not people. Try something like this:
> CREATE TABLE Marriages
> (husband_id INTEGER NOT NULL
> REFERENCES Men(id),
> wife_id INTEGER NOT NULL
> REFERENCES Women(id),
> marriage_date DATE NOT NULL,
> divorce_date DATE, -- null means still married
> CHECK (marriage_date <= divorce_date),
> marriage_location CHAR(3) NOT NULL DEFAULT 'Unknown',
> ... );
Don't wish to quibble over typo, but shouldn't that be
"...NOT NULL DEFAULT 'UNK'"? Paul...
-- Paul Linehan plinehan at yahoo dot com/linehanp at tcd dot ie I drink to keep body and soul apart - O. Wilde. "Mens sana in campari soda" - anon.Received on Sun Dec 23 2001 - 16:31:56 CET