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: Which normal form is this violating?

Re: Which normal form is this violating?

From: Larry Coon <larry_at_assist.org>
Date: Mon, 29 Apr 2002 15:35:12 -0700
Message-ID: <3CCDCAA0.114E@assist.org>


--CELKO-- wrote:

> I am not sure that it is foreign key constraint .. people write pretty
> bad code these days, so I did not assume specs.

People seem to leave more stuff out of their Usenet posts than their specs, so I figured it was at least equally reasonable to assume a FK existed.

> That would be MUCH better. What I would like to see is a CREATE
> DOMAIN statement (available in SQL-92) that makes this clear and works
> for all places that an attribute like "color" appears. The PK-FK
> approach is a work-around that gets abused really fast.
>
> 1) The referenced table holds a small number of values that would fit
> nicely into a CHECK (x IN (...)) clause. I have actually seen
> referenced tables with as few as four rows.
>
> 2) If I declare something have a color attribute, and I forget to
> "link" it to the look-up table, I think it has the right domain when
> it does not.

However, the PK-FK approach supports easier modification of the domain, via INSERT and DELETE statements.

Larry Coon
University of California
larry_at_assist.org
and lmcoon_at_home.com

The NBA Salary Cap FAQ:
http://members.cox.net/lmcoon/salarycap.htm Received on Mon Apr 29 2002 - 17:35:12 CDT

Original text of this message

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