What is the difference between primary key & unique index ?

Answer Posted / uddipto banerji

1. Primary Key is a column or a set of columns that uniquely identifies a row.Its purpose RECORD UNIQUENESS
2. Primary Key will not allow duplicate values.
3. Primary Key will not allow null.
4. Primary Key is not compulsory but recommended.
5. Primary Key helps to identify one record from another.
6. Only One Primary Key is allowed per table.
7. Unique Indexes is created automatically if there is Primary Key.
8. One table can combine upto 16 columns in a Composite Primary Key.
9. A table can have more than one Unique Key which is not possible in a Primary Key.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the contention situations caused by locks?

592


Why do we use cursor?

599


What are the various isolation levels possible?

649


What is the physical storage length of time data type?

673


List down the types of triggers in the db2 database?

590






What are the contents of dclgen?

658


How do you concatenate the firstname and lastname from emp table to give a complete name?

603


can any one provide me the link for the db2 v7 & db2 v8 manual for Z/os? i need to know about the syntax of REORG in both versions & need to know the difference as well

1806


What is null value in db2?

565


What is meant by dclgen?

618


How to take backup of table in db2?

601


What is with ur in db2?

758


Why do we bind in db2?

631


How to check last update on table in db2?

628


What is difference between rollback and commit?

634