Keys in Relational Model
Key A key is a single or combination of multiple fields. Its purpose is to access or retrieve data rows from table according to the requirement. The keys are defined in tables to access or sequence the stored data quickly and smoothly. They are also used to create links between different tables.
Types of Keys
Super key The set of attributes which can uniquely identify a tuple is known as Super Key. A table might have many super keys.
Candidate Key The minimal set of attribute in super key which can uniquely identify a tuple is known as candidate key.
Primary Key Primary Key: There can be more than one candidate key in a relation out of which one can be chosen as primary key.
Composite key or concatenate key A primary key that consists of two or more attributes is known as composite key.
Alternate key The candidate key other than primary key is called as alternate key.
Foreign Key A foreign key is an attribute or combination of attribute in a relation whose value match a primary key in another relation. The table in which foreign key is created is called as dependent table. The table to which foreign key is refers is known as parent table.
Secondary key Secondary key is a non-unique field. One secondary key value may refer to many records.
Sort Or control key A field or combination of fields that is used to physically sequence the stored data called sort key. It is also known s control key.
Comments
Post a Comment