![]() ![]() Also, a table can have multiple super keys.Įxample of super key : In the student details table, the super key consists of the roll number, aadhar number, registration number, roll number + name of the student (although the name of the student can't be unique its combination with roll number is always unique as the roll numbers are unique for each student). ![]() As the name suggests, it is superior to all, and all the candidate keys are the subsets of the super key, which means that all the candidate keys are the super key. ![]() Super key is the set of all those keys that uniquely identify a row. The name "candidate" is itself speaking that they are participating as the candidate.Įxample of candidate key : As we know that the roll number is the primary key for the student details table, but all the other columns like registration number, aadhar number are considered to be the candidate keys as they are also unique and not null. You might be wondering if it is similar to the primary key, but that's not the case because as we know that table can only contain one primary key, so all the remaining columns or a group of columns that are eligible to be a primary key are referred to as the candidate keys. Candidate KeyĬandidate key is also not null and a unique key that helps us uniquely identify rows in a table. Primary keys are always unique and they can't be NULL.Įxample of primary key : The roll number can be considered as the primary key for the student details table, as it uniquely identifies the data of each student. Primary key is a column or a group of columns that are used to uniquely identify the rows in a table. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |