Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Difference between primary key and unique key ?

Answers were Sorted based on User's Feedback



Difference between primary key and unique key ?..

Answer / vaithianathan

primary key not accepts null value and
not allows duplicate values.
but Unique key not allows duplicate values
but it accepts ONLY ONE NULL VALUE.

only one primary key allowed per table
we can create multiple unique keys
on the table

By Default, Primary key creates Clustered Index and Unique key Creates Non Clustered Index

Is This Answer Correct ?    3 Yes 0 No

Difference between primary key and unique key ?..

Answer / vijay

Primary key's main role is to make field as unique and
relates to other sub table. Whereas unique is role only to
keep unique value in that field.

Is This Answer Correct ?    4 Yes 2 No

Difference between primary key and unique key ?..

Answer / sripathi venkata ramesh

I am Sripathi Venkata Ramesh from Gudivada and the answer
is mentioned below

Primary key: A Primary key is a column or group of columns
used to uniquely identify each row in a table like
It defines the column as a Mandatory column.
The data held across the column must be unique.
By default it creates clustered index.
It does not allow null values and duplicate values


Unique key: It also for the record uniqueness.
It allows only one null value
By default it creates non clustered index

Is This Answer Correct ?    3 Yes 1 No

Difference between primary key and unique key ?..

Answer / avesh upadhyay,iims

are yar
primary key that does not accept null value
and in table only one exist.
but the case of uniue key that accept null value one or more
and many unique key exist in a single table

Is This Answer Correct ?    4 Yes 2 No

Difference between primary key and unique key ?..

Answer / boomiraj.p

Primary key: Do not allow the
duplicates and null values.
Unique key : Do not accept the
duplicates,but allow null value

Is This Answer Correct ?    2 Yes 0 No

Difference between primary key and unique key ?..

Answer / saga

--->We Define only one PK per table but it should have one
or more UK.
--->PK does not contain null but UK contains null.

Is This Answer Correct ?    2 Yes 0 No

Difference between primary key and unique key ?..

Answer / laxman k

1) Primary key can not accept null values, but unique can
accept null values.

2) only one primary key have in a table but max 249 unique
in a table

Is This Answer Correct ?    2 Yes 0 No

Difference between primary key and unique key ?..

Answer / bhushan tatar

column having primary key constraint should not contain
null values.

column having unique key constraint can contain null values.


Unique as well as primary key constraint can be
defined/applyed on more than one column.
EX.
ADD constraint uc_person UNIQUE(P_Id,Lastname)
ADD constraint uc_person PRIMARY KEY(P_Id,Lastname)

But whle creating table we can write unique key word
multiple time and primary key wprd only once.Because table
can have only one primary key and can have miltiple unique
key.But both can apply on more than one column.
and

Is This Answer Correct ?    10 Yes 9 No

Difference between primary key and unique key ?..

Answer / sandhya

Primary Key cannot contain null values
Each table has one and only one Primary Key
Primary Key is used to reference as Foreign key while
performing table joins
Clustered index is created on Primary Key

Unique Key can contain null value
A table can have any numberof unique keys
Non-clustered index is created on unique key columns

Is This Answer Correct ?    2 Yes 1 No

Difference between primary key and unique key ?..

Answer / deen dayal sharma

1. PRIMARY KEY & UNIQUE KEY both uniquely identity of each
row in a table.
2. BOTH keys will not contain repeated value.
3. One table may have more than one Unique Key Constraint But
it should have only one Primary Key Constraint column.
4. BUT UNIQUE KEY will contain NULL value but PRIMAY key will
not contain NULL value.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Oracle General Interview Questions

What is the difference between Sleep and Wait? (Java)

1 Answers   RBS,


how can get like this result table A col1 col2 --- ----- a A b B C C .. .. .. ... .. ... wants result like for a single column col1 ------ a,b,c,........n of data and another is col1 ------- A B C D ........ a b b d ........

2 Answers   TCS,


What is a data segment ?

1 Answers  


what is meant by magic query

0 Answers  


What is oracle rowcount?

0 Answers  


Differentiate between pre-select and pre-query?

0 Answers  


Table E: Name dept month sal 1 A JAN 800 2 B APR 1000 3 A JAN 300 4 A JAN 600 5 C JUN 400 1) SELECT HIGHEST SAL PAID DEPT IN JAN MONTH? 2) WRITE QUERY GET MAX SAL DEPT NO?

6 Answers   IBM,


What are the built-in functions used for sending Parameters to forms ?

0 Answers   Oracle, TCS,


how to find count rows in table without count function?

3 Answers   Oracle,


What is hash cluster in oracle?

0 Answers  


How to retrieve data from an cursor to a record?

0 Answers  


How do I learn what codesets are available in oracle?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • 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)