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 indexing?
How does normalization work?
how can we know that how many users are connected in perticuler server??????
How to verify a user name with sqlcmd tool?
Tell me about the approaches which you used to counter the DI problems.
If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?
How to convert character strings into numeric values?
Explain acid?
Write an SQL query if u want to select the data from one block which intern reflects in another block ? thanx,do reply
hi, how to match retrieve the unmatched records from 2 tables in which we dont have any primary key. example : table1 has 1,2,3,4,5 and table2 has 1,2,3,4,5,6,7,8,9,10 and i want the numbers from 6 to 10 to be displayed and should not come as null. i need the numbers. please reply as soon as possible.
How to modify an existing user defined function?
What are the steps you should follow to start sql server in single-user mode?
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)