What is a primary key, and how is it different from a unique key?
Answers were Sorted based on User's Feedback
Answer / nashiinformaticssolutions
• Primary Key:
o Ensures each row in a table is unique.
o Cannot contain NULL values.
o A table can have only one primary key.
• Unique Key:
o Ensures all values in a column are unique.
o Can contain a single NULL value.
o A table can have multiple unique keys.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
• Primary Key:
o Ensures each row in a table is unique.
o Cannot contain NULL values.
o A table can have only one primary key.
• Unique Key:
o Ensures all values in a column are unique.
o Can contain a single NULL value.
o A table can have multiple unique keys.
| Is This Answer Correct ? | 0 Yes | 0 No |
• Primary Key:
o Ensures each row in a table is unique.
o Cannot contain NULL values.
o A table can have only one primary key.
• Unique Key:
o Ensures all values in a column are unique.
o Can contain a single NULL value.
o A table can have multiple unique keys.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why are indexes and views important to an organization?
What is sql trigger example?
How do I write a cron which will run a sql query and mail the results to agroup?
Explain table and field in sql?
How to copy a table in another table with datas?
How many sql commands are there?
Can two tables have same primary key?
Where can I learn sql for free?
What is not equal in sql?
How long will it take to learn pl sql?
what are all the different types of indexes? : Sql dba
What is primary key in db?
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)