SQL Database Concepts Question:

Explain candidate key, alternate key, and composite key?

Tweet Share WhatsApp

Answer:

- Candidate Key is a key which provides the uniqueness of the column(s). It identifies each row of a table as unique. It can become the primary key of the table as well. Every tabular relationship will have atleast one candidate key.
- Alternate Key is a type of candidate key which is formed when there are more than one candidate key and one of them is a primary key then other keys will act as an alternate keys. Unique keys also termed as alternate keys which prevent incorrect data from entering the table.
- Composite Key is a special type of candidate key as it is formed by combining two or more columns. This gives assurance of uniqueness of data when the columns are joined together.

Read All 113 Basic SQL Server Questions
Previous QuestionNext Question
Do you know what is bit data type and whats the information that can be stored inside a bit column?Do you know what are ACID properties?