Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Using the same FK in a table more then once

Re: Using the same FK in a table more then once

From: -CELKO- <jcelko212_at_earthlink.net>
Date: 23 Sep 2006 08:21:35 -0700
Message-ID: <1159024894.910279.67010@k70g2000cwa.googlegroups.com>


>> Academically speaking.. is it acceptable to have this scenario? <<

Yes, but you will find that SQL Server and some oither products chock on it: Something like this?

CREATE TABLE Ownership
(item_id INTEGER NOT NULL

    REFERENCES Inventory (item_id),
 current_owner INTEGER NOT NULL

    REFERENCES Owners (owner_id),
 prior_owner INTEGER NOT NULL

    REFERENCES Owners (owner_id),
 PRIMARY KEY (item_id, current_owner),
 CHECK (current_owner <> prior_owner)); Received on Sat Sep 23 2006 - 10:21:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US