Database Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 2705 Page Views: 

What's the difference between a primary key and a unique key?



Posted By: Avi Date: 13 July 2009 09:00:39 PM
 Answer:

Both primary key and unique key enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique key creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULL values, but unique key allows one NULL value.


Posted By: eTechPlanet


Date: 13 July 2009 09:00:39 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image eLJ5hT
Related Questions
Database : What is ACID property?

What is ACID property?

ACID is the acronym for Atomicity,Consistency,Isolation and Durability. Whenever a transaction is ex....
Category: Database Date: 10/1/2010 11:46:07 AM
Database : How are one-to- one,one to many and many to many relationships implemented while designing the table?

How are one-to- one,one to many and many to many relationships implemented while designing the table....

1. One to one relationship:- This is the relationship which is used very rarely and is implemented o....
Category: Database Date: 10/1/2010 11:39:07 AM
Database : What is meant by RDBMS?

What is meant by RDBMS?

RDBMS means Relational Database Management System.This system manages the data records and indices i....
Category: Database Date: 10/1/2010 11:14:20 AM
Database : What is the difference between OLTP & OLAP?

What is the difference between OLTP & OLAP?

OLTP:- 1. It is based on entity relational model. 2. It inherits the concept of normalization so the....
Category: Database Date: 10/1/2010 11:14:07 AM
Database : What do you mean by OLTP?

What do you mean by OLTP?

OLTP means Online Transaction Processing systems which deals with relational database design and use....
Category: Database Date: 10/1/2010 11:13:07 AM