Re: Primary -- foreign keys

From: Mike Harris <datamodeler_at_yahoo.com>
Date: 10 Aug 2001 11:23:36 -0700
Message-ID: <73b5d23f.0108101023.4c68e814_at_posting.google.com>


For emample, in a "personnel" table you might want to record the id of each person's manager --- which would be the same as the employee id.

prk25_at_yahoo.com (keith) wrote in message news:<adbca63f.0108100550.b176fc5_at_posting.google.com>...
> Hi
>
> I am trying to understand why would anyone want to create the
> following:
>
> create table abc
> (
> x integer primary key,
> y char(20),
> foreign key (x) references abc(x)
> );
>
> What's being accomplished by creating a forein key which references a
> primary key of the same table??? Primary and foreign keys are on the
> same column of the same table????
>
> Thanks
>
> Keith
Received on Fri Aug 10 2001 - 20:23:36 CEST

Original text of this message