Super Key is a set of attributes or columns that uniquely identifies each row table whereas, a candidate key is a set of attributes that recognizes the tuples in a relation, or table.
...
Difference between Super Key and Candidate Key.
S.NO | Super Key | Candidate Key |
---|---|---|
3. | Every super key cannot be a candidate key. | All candidate keys are super keys. |
- What is super key example?
- What is a candidate key example?
- Under which condition a super key is also a candidate key?
What is super key example?
Super Key: The set of attributes that can uniquely identify a tuple is known as Super Key. For Example, STUD_NO, (STUD_NO, STUD_NAME), etc.
What is a candidate key example?
Roll_No: Roll_No is a candidate key as it can find all the rest attributes, i.e., ID, and Name of the table. Also, Roll_No does not contain any redundant attributes. ID: ID is a candidate key as it can find all the rest attributes, i.e., Roll_No, and Name of the table.
Under which condition a super key is also a candidate key?
Candidate Key is a Super Key whose no proper subset is a super key, i.e. suppose if ABC is a candidate key then neither A, B, C or any of its combination can be super key, hence we can say candidate key is a minimal set of attributes of an R( Relational Schema) which can be used to identify a tuple of a table uniquely.