Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Primary Key/Unique Key?
The main difference as has been already noted is that a unique key
allows NULLS in a column while a primary key does not. A table can only
have 1 primary key but it can have multiple unique keys. One of the
main reasons for having a unique key assuming that all columns are NOT
NULL might be as a key for another application. Example: an employee
table might have an employee_id as the primary key and this would be
used by the HR application, but the same table could have a unique key
of payroll_id that is used by a payroll application. Same table and
data but referenced in 2 ways.
Dave wrote:
> Whats the difference between making something
> a primary key and making something a unique key.
> From Oracles point of view that is.
> Dave
Received on Tue Dec 07 1999 - 16:43:25 CST