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 |
What is a join?
Can you have multiple SPs with the same name on a database?
how can you see all indexes defined for a table? : Sql dba
What is a sql statement?
what is the main difference between join and subqurey?
What is Pragma EXECPTION_INIT ? Explain the usage ?
What is the usage of when clause in trigger?
What is normalisation in sql?
in table there r so many rows write a query which two rows r updated last two day befor?
if a table is getting updated what happens if a function is called from sql query?
How to retrieve Duplicate Rows only in a Table? Suppose if a Table Name is "Education". It consists of multiple columns. Then if we insert rows into this table with duplicate records then how can we retrieve only duplicate records from that table?
29 Answers Alps, Aricent, Bank Of America, Wipro,
how to create temparary sequence
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)