Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Help: What is the difference between UNIQUE and PRIMARY KEY?
This explanation makes sense when you think of relational theory
If a table is normalized as much as possible then each record must be uniquely identifiable and there must be a value for each row which uniquely identifies it. I'd go further and suggest that if as well as a primary key you also find yourself making unique,not null constraints on non-key columns something has gone awry with the db design. (or possibly the implementation we have an app where every field in every table is not null and has an associated default value this doesn't feel like good design to me).
-- Niall Litchfield Oracle DBA Audit Commission UK "Steve Bell" <swayne.bell_at_sympatico.ca> wrote in message news:3AD590A9.D5785B7A_at_sympatico.ca...Received on Tue Apr 17 2001 - 05:21:10 CDT
> Hi,
>
> A unique field requires that each entry be different (unique) from every
> other record OR NULL.
>
> A primary key imposes a second condition, namely the NOT NULL
> condition...so, the field must be both unique and not null.
>
> Hope this helps,
> Steve
>
> u518615722_at_spawnkill.ip-mobilphone.net wrote:
>
> > I searched against metalink and could not find the
> > definition of unique index, could somebody help
> > me out?
> >
> > Thanks
> >
> >
> > --
> > Sent by dbadba62 from hotmail subpart of com
> > This is a spam protected message. Please answer with reference header.
> > Posted via http://www.usenet-replayer.com/cgi/content/new
>
![]() |
![]() |