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                      
Google
   
 
Categories >> Software >> Databases >> Oracle >> Oracle General
 
 


 

 
 Oracle General interview questions  Oracle General Interview Questions (720)
 OCI interview questions  OCI Interview Questions (10)
 Architecture interview questions  Architecture Interview Questions (75)
 Oracle Security interview questions  Oracle Security Interview Questions (37)
 Database Management interview questions  Database Management Interview Questions (265)
 Forms Reports interview questions  Forms Reports Interview Questions (466)
 Oracle AllOther interview questions  Oracle AllOther Interview Questions (183)
Question
Difference between primary key and unique key ?
 Question Submitted By :: Oracle-General
I also faced this Question!!     Answer Posted By  
 
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 ?    1156 Yes 121 No
Umapathy.r
 
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 ?    1010 Yes 126 No
Niranjan Dhungia
 
 
 
Answer
# 3
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 ?    324 Yes 90 No
Satya
 
Answer
# 4
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 ?    319 Yes 94 No
Prashant T.
 
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 ?    145 Yes 57 No
Austin Johnson
 
Answer
# 6
In the Table a primary key constraint column cannot holding
the null values.whereas unique constraint colum can holding
the null values.
Ex.|--------------------|
| ID(P) | Name(U) | #ID(P) ->It's a Primary Key
|--------------------| * Its a Not Null
| 1 | Hemendra | * A table Contain 1 Primary
| 2 | Neeraj | Key.
| 3 | PremJe | #Name(U)->It's a Unique Key
|NotNull |canbe Null| * Its can contain Null Value
|--------------------| * A table Contain more
than 1 unique Key.

Please Check the Radio Button..........
******************Gud Luck********************
 
Is This Answer Correct ?    43 Yes 0 No
Hemendra Singh Chaudhary
 
Answer
# 7
Primary key not accepts to null values in database, but
uniqe key accepts to the null values in database.
 
Is This Answer Correct ?    76 Yes 35 No
Anil Singh
 
Answer
# 8
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 ?    87 Yes 51 No
Sunil Upadhyay
 
Answer
# 9
* 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 ?    81 Yes 45 No
Jeyasree
 
Answer
# 10
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 ?    76 Yes 47 No
Ark Chowdary
 

 
 
 
Other Oracle General Interview Questions
 
  Question Asked @ Answers
 
In Oracle 9i what does "i" Stands for? MBT 36
How can we Update a table with out using UPDATE command?   1
what is difference between DBMS and RDBMS?   2
what is the difference between primary key & foreign key? Sparsh 57
What is dictionary cache ?   2
What is an Extent ?   2
difference between truncate and delete ,drop?   3
can we insert any row to dual table if i got the permission from DBA HCL 5
wirte the syntax of update query? IBM 3
SELECT * FROM (SELECT TITLE FROM MOVIE ORDER BY RANK DESC) WHERE ROWNUM > 4; when i run the above query .it produces output as NO ROWS SELECTED.why ?plz any one help me TCS 6
We have one Package(which has many function/procedures, SQL quires etc). Now we need to check, which query or procedure is taking lot of time in that Package. ? How do we do it. IBM 2
Indexes in oracle ? Keane-India-Ltd 3
 
For more Oracle General Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com