| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: FK relations...
Internet Coop wrote:
>
> Sure let me do a little better job of explaining..
>
> Three tables:
> Person
> car
> Car Parts
>
> Primary Keys
> Person:
> SSN
>
> CAR:(Information about a persons car)
> SSN
> VIN number
>
> Car Parts:
> SSN
> Vin number
> part number
>
<snip>
Couldn't the tables be set up like this?
Person:
Person-id meaningless number, assigned via sequence
SSN
CAR:
Person-id
VIN number
Car Parts:
Person-id
Vin number
part number
Maybe that's not feasible in your case.
In general I try to use sequence values for any attribute used to
uniquely identify a real-world object, especially is this attribute will
be present in many tables. (e.g. in the three tables above perhaps it
would be better to have a sequence instead of using VIN number in two
tables)
Of course there would probably be an index on SSN in the person table.
-- ___ ___ (___)=============================================================(___) | | Jacques Raymond Kilchoer MIS:Applications Support | | | | Assistant DBA /^\ ^ (714) 729-4500 x3733 | | | | Cost Care, Inc. /\ _/ \/ \ fax 729-4651 | | | | Newport Beach /\ /\/ \// \ \_/\ | | | | CA 92660 / \ / / \ / \ Suisse/Schweizer | | |___| ____/____\____/_________\___ _\_______ Svizzero |___| (___)=============================================================(___)Received on Fri Feb 28 1997 - 00:00:00 CST
![]() |
![]() |