GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus

 Print  |  
Question:  What is the basic difference between primary key and (unique key along with Not NULL).



March 03, 2007 16:27:02 #1
 Ritesh Raj Singh   Member Since: Visitor    Total Comments: N/A 

RE: What is the basic difference between primary key a...
 

Hi 


Basic Diffrence between primary key and unique key is the capability of unique key

for storing null values, a primary key on a column gurantees that the column must contain a value for a given row, but a unique key only guarantees that a column should be unique.


Apart from this difference , in oracle unique and primary key creates difference in

performance

e.g :  a primary key on a table enhance capability of using index

         on select count(*) from table_name  only if the table is analyzed

but a unique key won't

     

 

Back To Question