Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Table design question
"PeterS" <member_at_dbfoums.com> wrote in message
news:1724237.1029973526_at_dbforums.com...
>
> Hello everybody.
> I have a table where foreign key references the same table's primary
> key. Primary key is just one column as well as foreign key.
> Is it good design?
> Would it be better to create a separate lookup table?
> Foreign key column contains parents of a primary key column.
>
> Thanks in advance!
> Peter S.
>
> --
> Posted via http://dbforums.com
>
This is a pretty standard practice. Sometimes can be complicated to explain
to users.
You just have to decide if you can have nulls in the foreign key column.
If you don't allow nulls then must use a view (stored or inline) in order to
use oracle connect by or will get recursive error.
The main question is are the parents looked at as there own entity. If so
then separate table is ok, if the parents are thought of as a different
versions of the child then what you have suggested is usually correct.
zp Received on Wed Aug 21 2002 - 20:07:38 CDT