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 is the difference between UNIQUE KEY and UNIQUE INDEX?

Answers were Sorted based on User's Feedback



What is the difference between UNIQUE KEY and UNIQUE INDEX?..

Answer / 1

There is a clear difference between the 2. A unique
constraint defines what combination of columns has to be
unique. A unique index is just a way of making sure the
above is always valid. But it's possible to have a non-
unique index supporting a unique constraint. (if the
constraint is deferable = Only has to be valid at commit
time but is allowed to be broken in the middle of a
transaction)

Is This Answer Correct ?    1 Yes 0 No

What is the difference between UNIQUE KEY and UNIQUE INDEX?..

Answer / varsha

A UNIQUE Key grantees Unique values to a column but does not sort the column data, whereas A UNIQUE Index grantees Unique values to a column and also sorts the column data.

Is This Answer Correct ?    0 Yes 0 No

What is the difference between UNIQUE KEY and UNIQUE INDEX?..

Answer / mallik

Unique Index and Unique Constraint are the same. They
achieve same goal. SQL Performance is same for both.

Add Unique Constraint
ALTER TABLE dbo.<tablename> ADD CONSTRAINT
<namingconventionconstraint> UNIQUE NONCLUSTERED
(
<columnname>
) ON [PRIMARY]

Add Unique Index
CREATE UNIQUE NONCLUSTERED INDEX
<namingconventionconstraint> ON dbo.<tablename>
(
<columnname>
) ON [PRIMARY]

There is no difference between Unique Index and Unique
Constraint. Even though syntax are different the effect is
the same. Unique Constraint creates Unique Index to
maintain the constraint to prevent duplicate keys. Unique
Index or Primary Key Index are physical structure that
maintain uniqueness over some combination of columns across
all rows of a table. It is a convenient way to enforce a
Unique Constraint for SQL Server.

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More SQL PLSQL Interview Questions

Explian rowid, rownum? What are the psoducolumns we have?

0 Answers  


Give me some examples of predefined exceptions.

3 Answers  


What is data type in database?

0 Answers  


I have one table and column is c1 pk, c2 not null,c3 not null and 200 row in it and i add c4 column and value, how can is possible

9 Answers  


Difference between a query and strored procedure?

4 Answers   Microsoft,


How does a covering index work?

0 Answers  


What is the difference between nvl function, ifnull function, and isnull function?

0 Answers  


Which tcp/ip port does sql server run on? How can it be changed? : Sql dba

0 Answers  


What does select top 1 do in sql?

0 Answers  


What is query syntax?

0 Answers  


How can you create an empty table from an existing table?

0 Answers  


How do I edit a trigger in sql developer?

0 Answers  


Categories