what is difference between "Primary key" and "Unique key"?
Answers were Sorted based on User's Feedback
Answer / swapna
1)unique key can be null but primariy key cant be null.
2)primariy key can be refrenced to other table as FK.
Primary key and unique are Entity integrity constraints
Primary key allows each row in a table to be uniquely
identified and ensures that no duplicate rows
exist and no null values are entered.
Unique key constraint is used to prevent the duplication of
key values within the rows of a table and allow null
values. (In oracle, one null is not equal to another null).
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / satya_k21
Hi,
Primary Key: Not Null+ unique.but it wont allows null
values.
Unique: It allows null values , but it should be unique.
Regards,
Satya.k
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / nitin gupta
Uniques: Enforce unique data in the database
it allows row containing null value but only once
It implements non clustered index.
primary key: Enforce unique data in the database
it don't allow any record containing null value
it implements clustered index (data physically
sorted)
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kk
PRIMARY KEY=UNIQUE KEY+ NOT NULL KEY so its a combo drive
| Is This Answer Correct ? | 1 Yes | 2 No |
what is the difference between a web-garden and a web-farm? : Sql dba
What is a call statement? Explain with an example.
Is drop table faster than truncate?
What is left join example?
What are stored procedures in mysql?
How many joins can you have in sql?
What is sql dialect?
What is an index in sql with example?
what is a cursor
what is the difference between inner and outer join? Explain with example. : Sql dba
What is indexes?
Explain the order of sql statement execution?
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)