Difference between primary key and unique key ?
Answers were Sorted based on User's Feedback
Answer / tom
There is two difference between them.
1. The not null constraint is by default added to primary
key, it means, primary key attribute cannot accept null
values, whereas, the attribute declared as unique can accept
null values. It is the major difference between the two.
2. Secondly, we can have only one primary key in a relation,
whereas, multiple attributes can be declared unique at the
same time.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / jason james john
unique key is a key that uniquely defines the characteristics of each row whereas primary key consists of characteristics that cannot collectively be duplicated by any other row.primary key will not allow null values whereas unique key will allow nulls.
Is This Answer Correct ? | 1 Yes | 0 No |
primary key does not null,but unique key also null.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / rajkumar tiwari
Primary key contain non repetitive value and not null
value,and primary key is created on clustered index.In the
table their should be one primary key column.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / himanshu porwal
Primary key does not allow null values whereas in UNIQUE constraint we can have 1 null value means for that column one null value is allowed.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / praveen
primary key not allows null values, but unique key allows null values. only one primary is possible in one table, but multiple unique keys are possible in a table. Each unique key accepts only one null field. Both are used to prevent repeated entry of values.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / suman chatterjee.
uniqe key may contain null values but primary key can not take the null values.
Is This Answer Correct ? | 3 Yes | 3 No |
Answer / mareeswaran-jeyakani
The primary key cannot be accept the null values.The unique key can accept null values. assume that you have a two
columns column1 having primary key constraint and column2 having unique constraint if u try to insert null into column2 it will accept that values whereas column1 will not accept the null values.
THANK YOU.ALL THE BEST...............
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / yogesh kumar
primary key is unique define in a table, it means if u
declare primary key value is not allows duplicate and null.
unique key allows repeats' a value and null.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the best way to do multi-row insert in oracle?
what is the difference between UNION AND UNIONALL
I have two tables : COuntry,city I want all the cities in each country.Question on Cross Join.
How to create a new view in oracle?
hai, when to use char and varchar2....?
Point the difference between translate and replace?
how to get last monday of a month?
How we can able to import our own template (users designed MS-Word templates) which has many tabular columns; need to pass some values generate by Oracle-reports9i? Actually need to import more than 400 MS-Word templates into Oracle Reports-9i to minimize layout design in Reports.
What is a tns service name?
Explain the difference between replace() and translate() functions in oracle?
acname actype amount ac1 credit 300 ac2 credit 4000 ac1 debit 4000 ac2 debit 455 ac1 credit 500 how to get sum of credit and sum of debit for each account
What is a package ? What are the advantages of package ?