Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / raj

In primary key not allowed any null value while in unique
key one null value allowed.

Is This Answer Correct ?    22 Yes 1 No

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

Answer / srinivas

Primary key is a combination of unique+not null+cluster
index and it will not allow any duplicate values, null
values, and it's data will be arranged in ascending order
due to clustered index. Only one primary key is allowed
per table.

Unique key is a key which will not accept any duplicate
values, but it will accept one null value. We can place
any number of unique keys per table.

Is This Answer Correct ?    17 Yes 0 No

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

Answer / awdhesh

By default Primary Key Create Cluster index while unique
ker create non cluster index

Is This Answer Correct ?    17 Yes 1 No

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

Answer / sachin patil

only 1 p.K. have per table

u can have multipale Unique key per table

Is This Answer Correct ?    15 Yes 4 No

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

Answer / karthick

PRIMARY KEY AND UNIQUE KEY

* Both Enforces Uniqueness
* Primary key Creates clustered index
unique key creates non clustered index
* primay key does not allows null value
unique key allows 1 null value

Is This Answer Correct ?    10 Yes 0 No

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

Answer / karthikumar

The difference is primary key does not allow any one null
value,but unique allow only one null value,because it
consider null as one value

Is This Answer Correct ?    8 Yes 1 No

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

Answer / mrityunjay kumar

There are difference between Primary key and unique key.

1. Primary key allow not null value where as unique key
allow only one null value.

2. Primary key Creates clustered index where as unique key
creates non clustered index.

3. Primary key is only one in a table where as unique key
is multiple in a table.

4. Primary key is not accept duplicate value where as
Unique key is also not accept any duplicate values, but it
will accept one null value.

Is This Answer Correct ?    8 Yes 1 No

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

Answer / sunil

HI ALL

IN CASE OF INSERTING REPETED NULL IN UNIQUE KEY COLOUMN ,
IF IT IS COMPOSITE KEY IS POSSIBLE. . . ANY LOGICAL RESON?

Eg:
CREATE TABLE TRY(ROLL NUMBER,LIB_CARD_NO NUMBER,
CONSTRAINT CON_UNQ UNIQUE(ROLL,LIB_CARD_NO));

INSERT INTO TRY VALUES(NULL,NULL);
--> 1 ROW CREATED
INSERT INTO TRY VALUES(NULL,NULL);
--> 1 ROW CREATED -- REPETED NULL ARE ALLOWED!!!!

Is This Answer Correct ?    2 Yes 0 No

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

Answer / amit

-Both are Unique means they do not accept duplicate value.

-Primary key by default Clustered Index where as Unique Key
is a Non-Clustered Index.

-Primary Key does not accept null value where as Unique Key
accept only one Null Value.

-A table can have only one Primary Key where as A table can
have multiple Unique Key.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / hameed

Primary key does not allow any null value in a table where
as Unique key allows only one null value

Primary key is by default a Clustered Index where as Unique
key is a non-clustered index

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What is the downside of using udf?

0 Answers  


How you can get a list of all the table constraints in a database?

0 Answers  


How optimize sql query with multiple joins in sql server?

0 Answers  


What is user-defined multi-statement table-valued function?

0 Answers  


Can we write ddl in trigger?

0 Answers  


How to use old values to define new values in update statements in ms sql server?

0 Answers  


how many instance use in sql server 2005

4 Answers   EFI, HCL,


what is an extended stored procedure? Can you instantiate a com object by using t-sql? : Sql server database administration

0 Answers  


What is sql injection? How to protect against sql injection attack?

0 Answers  


Advantages and disadvantages of stored procedures.

2 Answers   HCL,


What are the default system databases in sql server 2000?

0 Answers  


how to copy only distinct data into another table which is not already exist in database?

2 Answers   Spectra,


Categories