Re: Primary -- foreign keys
Date: Sat, 11 Aug 2001 05:30:28 GMT
Message-ID: <Up3d7.5955$NJ6.27687_at_www.newsranger.com>
In article <adbca63f.0108100550.b176fc5_at_posting.google.com>, keith says...
>
>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????
Nothing is accomplished, you are correct. Note however that abc.x->abc.x is perfectly legal (although, trivial) functional dependency. Disallowing it would be similar to forbidding multiplication by 1.
I don't imply that the database must create real constraint, like oracle 8.1.7, with index, storage, etc in this case, however. Received on Sat Aug 11 2001 - 07:30:28 CEST
