GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 219 of 241    Print  
What is the need of primary key as opposed to using not null and unique ?
we can create a column with' not null+unique' with out using primary key


  
Total Answers and Comments: 4 Last Update: July 02, 2009     Asked by: sreeraghava.nara 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: KD09714
 
1) Primary key creates clustered index by default which actually reorders the row in a table based on index while unique key creates non-clustered index.

2) Replication of table possible only if it contains primary key.    

Above answer was rated as good by the following members:
pathakprashant008, suparna.goswami, ksbavv, kperumal75, go2lightspeed
June 22, 2008 03:57:29   #1  
stshekhar Member Since: June 2008   Contribution: 5    

RE: What is the need of primary key as opposed to using not null and unique ?
One simple diff : there can only one primary key per table but not null+unique can be multiple on one table.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
July 01, 2008 09:46:58   #2  
KD09714 Member Since: June 2008   Contribution: 11    

RE: What is the need of primary key as opposed to using not null and unique ?
1) Primary key creates clustered index by default which actually reorders the row in a table based on index while unique key creates non-clustered index.

2) Replication of table possible only if it contains primary key.

 
Is this answer useful? Yes | NoAnswer is useful 3   Answer is not useful 1Overall Rating: +2    
July 01, 2008 09:52:33   #3  
KD09714 Member Since: June 2008   Contribution: 11    

RE: What is the need of primary key as opposed to using not null and unique ?
1) Primary key creates clustered index by default which actually reorders the row in a table based on index while unique key creates non-clustered index.

2) Replication of table possible only if it contains primary key.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
July 02, 2009 02:45:29   #4  
ashu.gupta Member Since: July 2009   Contribution: 1    

RE: What is the need of primary key as opposed to using not null and unique ?
Along with the answers mentioned above

To add cascading is only possible when it follow primary key - foriegn key constraint.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape