Difference between Primary and Unique key



Difference between Primary and Unique key


Distinguish, differentiate, compare and explain what is the main difference between Primary and Unique key in database programming. Comparison and Differences.

Difference between Primary and Unique key

1 There is only one Primary key for a table. There may be more than one Unique Key for a table.

2 Primary Key cant contain a NULL value. Unique Key can contain only one NULL Value per column in a unique index column in SQL Server and DB2 (in Oracle Unique Key can have any number of NULL per column).

3 Primary Key creates a clustered index by default. Unique key creates a unique non-clustered index by default.




Tags:

Difference between Unique key vs Primary

Primary vs Unique key

Differences between Unique key vs Primary

Spreading Knowledge Across the World

USA - United States of America  Canada  United Kingdom  Australia  New Zealand  South America  Brazil  Portugal  Netherland  South Africa  Ethiopia  Zambia  Singapore  Malaysia  India  China  UAE - Saudi Arabia  Qatar  Oman  Kuwait  Bahrain  Dubai  Israil  England  Scotland  Norway  Ireland  Denmark  France  Spain  Poland  and  many more....