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

Home -> Community -> Usenet -> c.d.o.server -> Re: Can a surrogate key be a foreign key?

Re: Can a surrogate key be a foreign key?

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Fri, 6 Aug 2004 06:19:25 +1000
Message-ID: <41129620$0$29782$afc38c87@news.optusnet.com.au>

"John" <jbradshaw777_at_yahoo.com> wrote in message news:f2f59d82.0408050916.27ccdefd_at_posting.google.com...
> Hi all,
>
> Is there a clear definition of what a surrogate key is? Does a
> surrogate key imply a candidate key? Would it make sense to say that a
> particular foreign key of a table is a surrogate key?
>
> John

Tom's answered, and correctly AFAICT. I tend to call 'surrogate' keys "synthetic" keys, as do a few others I can think of. It simply means you use an arbitrary sequence number as a row's primary key, instead of finding a 'natural' primary key from the table's real columns.

Of course, the primary key of one table can become the foreign key of another (DEPT's primary key is referenced by a DEPTNO field in the EMP table). And if that primary key was indeed a synthetic/surrogate key, then yes I suppose you could say that EMP's foreign key is indeed a synthetic one, too. Or maybe, more accurately, that it *references* a synthetic/surrogate key. I'm not sure what you'd gain from describing it that way, but I suppose you could.

Regards
HJR Received on Thu Aug 05 2004 - 15:19:25 CDT

Original text of this message

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