Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Separate foreign keys with shared ID space

Re: Separate foreign keys with shared ID space

From: Christian Antognini <christian.antognini_at_trivadis.com>
Date: Sat, 31 Jul 2004 04:11:24 +0200
Message-ID: <410affcf$1@post.usenet.com>

Hi Robert

> It seems like type hierarchies are a common technique in relation
> design. What approaches do people use to provide relational integrity
> in cases like this? Should I add the customer_type column to the
> subtypes and then use composite foreign key?

A PK should have no business meaning. Therefore, I'll not add such a column to the primary key.

Once I solved such a problem with as many parent tables as child tables and then by putting a views that aggregated the information over the different types of customer. Of course it is only a good solution if you rarely query all customers at the same time. Another drawback is that the primary key cannot be guaranteed for the whole customers. But, if you generate the customer id with a sequence, this should not be a problem.

Chris

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Received on Fri Jul 30 2004 - 21:11:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US