Re: Is an FK constraint possible against a non-unique column

  • From: Kevin Hale Boyes <kcboyes@xxxxxxxxx>
  • To: Guillermo Alan Bort <cicciuxdba@xxxxxxxxx>
  • Date: Fri, 23 Jul 2010 14:55:51 -0600

On Fri, Jul 23, 2010 at 1:59 PM, Guillermo Alan Bort
<cicciuxdba@xxxxxxxxx> wrote:
> From a database theory point of view, a FK points to a PK in another
> relationship (table). So no, it should not be possible to have a FK to a
> non-unique column. What you can do is use either a trigger or a check
> constraint.

I don't know how a check constraint can be used.  I thought a check
constraint wasn't able to reference other tables.
We may end up going with the trigger idea though.

> However, if you need to have a FK pointing to a non-unique columnt, you
> database design needs normalization.

Maybe.  One design element that I didn't mention was that the
APPROVED_PO table has been heavily de-normalized.
Once a PO is approved, references to other things like the product
name must not change even if someone
changes the name of the product in its table.

Thanks,
Kevin.
--
//www.freelists.org/webpage/oracle-l


Other related posts: