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

Home -> Community -> Usenet -> comp.databases.theory -> Re: Multiple parent design

Re: Multiple parent design

From: Laconic2 <laconic2_at_comcast.net>
Date: Fri, 16 Apr 2004 08:26:24 -0400
Message-ID: <bJOdnQJ_0eNfTeLdRVn-uA@comcast.com>


Some people may object to my previous suggestion, because it relies on NULLS. Here's an alternative:

Take the parent_id out of the phone table.

Create two new tables:

create table PERSONAL_PHONE
  (PHONE_ID,
   PERSON_ID); create table COMPANY_PHONE
  (PHONE_ID,
    COMPANY_ID); Put in the appropriate constraints for referential integrity, and relationships. A PHONE_ID must exist in one and only one of these two tables.

"Laconic2" <laconic2_at_comcast.net> wrote in message news:64GdnYurVfsYVOLdRVn-sQ_at_comcast.com...
> Create two columns in the phone table, Person_id and Company_id. Enforce
> referential integrity on each one separately. Allow each one to be NULL.
>
> If necessary, enforce a constraint that either Person_id or Company_id
must
> be null.
>
>
Received on Fri Apr 16 2004 - 07:26:24 CDT

Original text of this message

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