SQL Candidate key with Example

aimtocode

Candidate Key

it is the attribute/column or a set of attributes/columns in a relation/table that qualifies for uniqueness of each tuple/row. A relation/table can have one or more than one Candidate Keys.

A Candidate key is also known as a minimal Super key.

Properties of Candidate key:

  • It must contain unique values
  • Candidate key may have multiple attributes
  • Must not contain null values
  • It should contain minimum fields to ensure uniqueness
  • Uniquely identify each record in a table
StudID Roll No First Name Last Name Email
1 11 Prayag Verma support@aimtocode.com
2 12 Rahul Raz rahulraz@gmail.com
3 13 Pankaj Jacker pangu@gmail.com
4 14 Mukesh Mugu mugu@gmail.com
5 15 Rakesh Ravi rakeshravi@gmail.com


Read Also:


aimtocode