| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: modeling either/or relationship...
paul c wrote:
> -CELKO- wrote:
> > > No comment about the design but not knowing much about SQL, I'm > wondering if the "overlapping candidate keys" (ignoring whether the term > as used here is wrong) is a way of "trick"ing some products into > allowing a reference to different columns than those of a primary key? > > Would interchanging the columns of the PRIMARY KEY and UNIQUE clauses > behave the same? Also, do all/most of the SQL products require a > foreign key to reference a primary key? (If so, I don't understand why.) > > cheers, > p >
AFAIK in standard SQL the PRIMARY KEY / UNIQUE constraints are interchangeable except that UNIQUE may include nullable columns whereas PRIMARY KEY may not and is the default for a foreign key reference if no other column(s) are specified using REFERENCES.
SQL's idea of designating a PRIMARY key from among the candidate keys is apparently a legacy of Codd's use of that term. If it has a useful purpose at all I guess it's to act as a hint to the DBMS on how to implement that key physically.
-- David PortasReceived on Wed Feb 01 2006 - 10:46:14 CST
![]() |
![]() |