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: Primary Key/Unique Key?

Re: Primary Key/Unique Key?

From: Douglas Scott <dsscott_at_ev1.net>
Date: Tue, 07 Dec 1999 16:43:25 -0600
Message-ID: <384D8D8B.2A11BF52@ev1.net>


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

Original text of this message

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