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 CONSTRAINT and
PRIMARY KEY?

1. There is no difference.
2. A PRIMARY KEY cannot be declared on multiple columns.
3. A UNIQUE CONSTRAINT cannot be declared on multiple
columns.
4. A table can have multiple PRIMARY KEYS but only one
UNIQUE CONSTRAINT.
5. A table can have multiple UNIQUE CONSTRAINTs but only
one PRIMARY KEY.

Answer Posted / andsens

Fields in UNIQUE CONSTRAINTs can be NULL. They cannot with PRIMARY KEYs.
You can define more than one UNIQUE KEY in a table.
Because of this, the behaviour of UNIQUE CONSTRAINTs is very different from PRIMARY KEY constraints. As long as one of the fields in a UNIQUE CONSTRAINT is NULL the constraint itself does not apply and you can set the other fields to whatever you want without getting an error.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql injection vulnerability?

937


How much does a sql dba make? : SQL DBA

935


what is auto increment? : Sql dba

1000


can a stored procedure call itself or recursive stored procedure? : Sql dba

1020


Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql

976


what is a composite key ? : Sql dba

1043


What is sql*loader and what is it used for? : aql loader

1167


Is there a way to automate sql execution from the command-line, batch job or shell script?

964


What is a string data type in sql?

1029


What is inner join in sql?

1070


What is memory optimized?

1074


How exception handling is done in advance pl/sql?

974


What is the maximum database size for sql express?

1016


how to fetch alternate records from a table? : Sql dba

1100


What does fetching a cursor do?

1077