| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: A foreign key on a self-referring table
Andrea Laforgia wrote:
> Thank you for all your answers.
>
> I was imagining it was weird just because I assumed that, whether, for
> a strange reason, a record pointed to itself, the DBMS would not allow
> to delete it. If I had, for instance:
>
> |--------------------------|
> |CustomerID = 100 |(PK)
> |--------------------------|
> |Name = .... |
> |City = ... |
> |ZipCode = ... |
> |CustomerID = 100 |(FK)
> ----------------------------
>
> Would the DBMS let delete that record ?
It has to be inserted first. Before that the table has to be created. That won't happen until there is a way to distinguish CustomerID (PK) from CustomerID (FK).
Naming attributes is a nice moment to contemplate *meaning*. The meaning of the CustomerID (PK) is assumedly (from the context) "A customer is identified by CustomerID". But what is the meaning of CustomerID (FK)? In other words: what hierarchy are you building? Received on Fri Mar 05 2004 - 07:43:18 CST
![]() |
![]() |