ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
   
 
Categories  >>  Software  >>  Databases  >>  Oracle  >>  Oracle General
 
 


 

 
 Oracle General interview questions  Oracle General Interview Questions
 OCI interview questions  OCI Interview Questions
 Architecture interview questions  Architecture Interview Questions
 Oracle Security interview questions  Oracle Security Interview Questions
 Database Management interview questions  Database Management Interview Questions
 Forms Reports interview questions  Forms Reports Interview Questions
 Oracle AllOther interview questions  Oracle AllOther Interview Questions
Question
Difference between primary key and unique key ?
 Question Submitted By :: Neelam
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Difference between primary key and unique key ?
Answer
# 1
The column holding the primary key constraint cannot accept
null values.whereas colum holding the unique constraint can
accept null values assume that t3 is a table with two
columns t1 having primary key constraint and t2 having
unique constraint if u try to insert null into t2 it will
accept that values whereas column t1 will not accept null
 
Is This Answer Correct ?    1147 Yes 120 No
Umapathy.r
 
  Re: Difference between primary key and unique key ?
Answer
# 2
Primary key doesnot allow null value but unique key allows
null value. We can declare only one primary key in a table
but a table can have multiple unique key(column assign).
 
Is This Answer Correct ?    1002 Yes 126 No
Niranjan Dhungia
 
 
 
  Re: Difference between primary key and unique key ?
Answer
# 3
First difference is that primary key doesn't accept null
values whereas unique accepts one or multiple.
second difference is that Clustered index is created on
Primary key constraint and non clustered unique indexes is
created on Unique key constraint.
 
Is This Answer Correct ?    314 Yes 93 No
Prashant T.
 
  Re: Difference between primary key and unique key ?
Answer
# 4
Primery Key = (Unique key - NULL values)

One table may have more than one Unique Key Constraint
columns, but should have only one Primary Key Constraint
column.

Any comment? please shoot a mail.
 
Is This Answer Correct ?    323 Yes 89 No
Satya
 
  Re: Difference between primary key and unique key ?
Answer
# 5
we can't insert a NULL value into to coloumn holding
primary key constrain.
where as we can insert a NULL value to a unique key feild.
Remember, both keys are used to identify the
rows/tuple/entry of the table uniquely.
so, only once u can enter a NULL value into the unique key
feild.
 
Is This Answer Correct ?    144 Yes 56 No
Austin Johnson
 
  Re: Difference between primary key and unique key ?
Answer
# 6
the basic difference is that primary key can not have null
value whereas Unique key can have null values.two null
value are not same.One table may have more than one Unique
Key Constraint
columns, but should have only one Primary Key Constraint
column.
 
Is This Answer Correct ?    85 Yes 50 No
Sunil Upadhyay
 
  Re: Difference between primary key and unique key ?
Answer
# 7
7. Primary Key doesnt allow the Null Values. where as in
Unique accept the Null values.
One table may have more than one Unique Key Constraint.
But it sholud have only one Primary Key Constraint column.
 
Is This Answer Correct ?    74 Yes 47 No
Ark Chowdary
 
  Re: Difference between primary key and unique key ?
Answer
# 8
* Only one primary key is allowed per table (any number of
unique keys are allowed).
* Primary key columns automatically become NOT NULL (unique
keys can contain nulls).
* UNIQUE and DISTINCT are synonymous in a SELECT list.
 
Is This Answer Correct ?    79 Yes 44 No
Jeyasree
 
  Re: Difference between primary key and unique key ?
Answer
# 9
Each table having only one PRIMARY KEY.And my contain many
UNIQUE KEYS.
PRIMARY KEY is identity of each row. UNIQUE KEY also
identity of each row.
BOTH keys will not contain repeated value.
BUT UNIQUE KEY will contain NULL value but PRIMAY key will
not contain NULL value.
 
Is This Answer Correct ?    62 Yes 47 No
Pralhad
 
  Re: Difference between primary key and unique key ?
Answer
# 10
Primary key not accepts to null values in database, but
uniqe key accepts to the null values in database.
 
Is This Answer Correct ?    73 Yes 35 No
Anil Singh
 

 
 
 
Other Oracle General Interview Questions
 
  Question Asked @ Answers
 
can u call user defined functions in select statements  2
Hello All, Could any one provide me FAQs/interview questions on oracle PL/SQL  1
What is Hash Index?  1
5. Display full details from the ORDER_LINE table where the item number is (first condition) between 1 and 200 (no > or < operators) OR the item number is greater than 1000 AND (second condition) the item cost is not in the list 1000, 2000, 3000 OR the order number is not equal to 1000. Wipro3
select * from emp what happened internally when we write this query in the sql prompt?  5
how to find find & delete duplicate rows from two different tables? TCS3
what is mean by prmary key and foreign key and how can we diffrentiate that? Please answer me. Advance thanks. Excel9
What are the type of Synonyms?  1
What is the difference between normal and corelated subqueries?  2
what r routers?  1
One Table having two rows with one colomn having values Like"Male" and "Female". how to upadte these values Like "Female" and "Male" in single update statement. Polaris4
How to display the hierarchy of employee and managers without using connect by prior.  1
 
For more Oracle General Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com