What's the difference between a primary key and a unique
key?
Answers were Sorted based on User's Feedback
Answer / swapna
Both primary key and unique 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 creates a nonclustered index by default. Another
major difference is that, primary key doesn't allow NULLs,
but unique key allows one NULL only.
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / ramneet
There is one more diff b/w primary key and unique key that
there is only one primary key in a table but there are more
then one unique keys in a table.
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / gowthami radhakrishnana
1)primary key uses clustered index
unique key uses non-clustered index
2)primary key doesn't allow null values
but unique allows one null value
3)there is only one primary key but more than one unique
keys
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / ramneet
Primary can be used in foregin key but unique key does not
used.
| Is This Answer Correct ? | 4 Yes | 2 No |
What is triggers and its types?
What is 3nf normalization form?
what is the query and condition to delete datas in sql server.
What is the simplest way to create a new database in ms sql server?
write query for fourth maximum salary from employee table
14 Answers Mind Tree, SP Software,
How to change the name of a database user?
What is cursors?
What is the Disadvantage of indexed sequential file.
What is a group function explain with an example?
What is the use of floor function in sql server?
What is a transactions?
What are the benefits of normalization?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)