Except for the primary key, the remaining attributes are considered a candidate key.A candidate key is an attribute or set of attributes that can uniquely identify a tuple.For each entity, the primary key selection is based on requirements and developers.In the EMPLOYEE table, we can even select License_Number and Passport_Number as primary keys since they are also unique. In the EMPLOYEE table, ID can be the primary key since it is unique for each employee.The key which is most suitable from those lists becomes a primary key. An entity can contain multiple keys, as we saw in the PERSON table. It is the first key used to identify one and only one instance of an entity uniquely.In the PERSON table, passport_number, license_number, SSN are keys since they are unique for each person. It is also used to establish and identify relationships between tables.įor example, ID is used as a key in the Student table because it is unique for each student. It is used to uniquely identify any record or row of data from the table.Keys play an important role in the relational database.
0 Comments
Leave a Reply. |