What is the difference between a primary key and a unique key constraint?
- Both primary key and unique key are the same
- Primary key allows duplicate values, Unique key does not
- Primary key can have null values, Unique key cannot
- Unique key can have null values, Primary key cannot
The key difference is that a primary key cannot have null values, ensuring each record is uniquely identified, while a unique key can have null values, allowing for some flexibility in data constraints.
Loading...
Related Quiz
- What is the primary difference between document-based NoSQL databases and key-value stores?
- Scenario: A multinational corporation operates data centers across different regions. How would you design a partitioning strategy to ensure efficient data distribution and access in a globally distributed environment?
- What are the advantages of using a Star Schema over a Snowflake Schema in data warehousing?
- What are some common challenges faced during collaborative data modeling projects?
- In NoSQL databases, which consistency model sacrifices consistency in favor of availability and partition tolerance?