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

Is db2 a mainframe?

678


Are view updateable?

710


What is precompiler in db2?

669


What do you mean by between and in? Is between inclusive of specified range values?

769


What is innodb buffer pool?

641






What is the difference between oracle and db2?

675


Highlight all the advantages that are attached to a package.

728


What is package in cobol db2?

773


List down the types of triggers in the db2 database?

684


What is deadlock in db2?

677


How can we read records for specific member in CL? AND rpg?

322


What is nvl in db2?

727


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

682


Is it possible to create an Instance in DB2 using DB2 Control Center ?

713


List some fields from sqlca?

682