Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Normalization, Natural Keys, Surrogate Keys
> > Neglecting to declare a natural key undermines your ability to protect
> > the integrity of your data.
>
> A natural unique index should suffice. Then a generated key makes for a
> much easier to understand and code to model, (in my opinion). Restrict
> on the natural fields to restrict on but join on the generated keys. To
> me, this just seems a whole lot easier to understand and code to, which
> makes for more successful projects.
Would there be anything wrong with doing this the other way around? Making the primary key the natural key, but then creating a surrogate key, which is an auto-number column with a unique constraint on it? This way, you keep the model 'correct', but provide development ease with your candidate key column.
Tobin Harris
> Galen deForest Boyer
> Sweet dreams and flying machines in pieces on the ground.
Received on Fri May 17 2002 - 05:01:20 CDT
![]() |
![]() |