Difference between primary key and unique key ?

Answers were Sorted based on User's Feedback



Difference between primary key and unique key ?..

Answer / ranjeet kumar

There is only one primary key in a table but multiple unique
key.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / shakeel shikari

the difference is only primary key does not accept null values
while unique key accept null value
remember that unique key holds null only once

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / ankit kumar singh

Primary Key:
* Primary Key can not contain null value
* Clustured index is created in Primary key.
* Primary Key allows Each row in a table to uniquely
identified and insures that no applicable row exists.

Unique Key:

* Unique Key can contain null value.
* More than one Unique key in a table can be declared.
* Non-clustered index is created in unique key.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / susil kumar rout

When we applied primary key constraint upon a column of a table internally oracle create a cluster index.In case of unique constraint,oracle create a non-cluster index.
In a table or entity one primary key and one or more than one
unique key can be applied.
We can't insert duplicate value or null value to primary key
column where as null value can insert into unique key column.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / nithin

1. There can be more than one unique key in a row or table
but there can be only one primary key in a row or table.

2. Primary key does not accept NULL values but Unique key
accepts even NULL values.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / arpit sachan

Primary key Accept only one Null Value...But a Unique key Accept one or More Null value........

create table #foo(id varchar(5)primary key,name varchar(10));

insert into #foo('','Your name');

---------->> see the result.....

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / omkar

In any table there can be one and only one primary key
(composite priamry key can have more than 1 column but
together conside one key only) but more than one unique
keys.

Primary key cannot accecpt null value.unique key accecpts
one or more than one null values.

primary key uniquly identifies the table but unique key is
used for uniquly identified of table as it contain one or
more than onee null.

Clustered index is created on
Primary key constraint and non clustered unique indexes is
created on Unique key constraint.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / madhusudan reddy paila

Primery Key is allows the null value but unique wont accept
the null values in database ....

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / dinesh

Primary Key:
It wont accept NULL values.
It wont accept Duplication.
Unique Key:
It accepts NULL values.
Foreign Key:
It accepts NULL values.
It accepts Duplication.
Main point is, A Foreign key denotes a Primary key in the another table.

Is This Answer Correct ?    0 Yes 0 No

Difference between primary key and unique key ?..

Answer / chandra bhan kumhar

1. Primary key accepts a value only single time not more then one time means it doesn't allow repetition same as for unique key.
2. Primary key don't allow null values ,but unique key allow null values.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

What are the uses of Database Trigger ?

0 Answers  


How to handle a single quote in oracle sql?

0 Answers  


What is the dynamic sql in oracle?

0 Answers  


What are the different editions of oracle?

0 Answers  


Tell me New Feature of Oracle 10g?

5 Answers   Thermotech,






Hi Every One , What is the table Space in Oracle Database ? waiting for answere and thankyou

8 Answers  


How to call a stored function in oracle?

0 Answers  


What is an oracle data file?

0 Answers  


What is a subquery?

0 Answers  


What is a static data dictionary in oracle?

0 Answers  


What are the types of synonyms?

1 Answers  


does the query needs a hint to access a materialized view?

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)