Class 4
Class 4
Types of keys:
1. Super Key
A Super key is a combination of all possible attributes that can uniquely identify the
row(or tuple) in the given relation
2. Super key is a superset of candidate key.
3. A table can have much supper key.
4. A super key may have additional attribute that are not needed for unique identity and
have null value.
…etc
2. Candidate Key :-
A Candidate key is an attribute or set of an attribute which can uniquely identify a
tuple(row).
It is also called the minimal super Key because we select of candidate key form set of
super key such that select candidate key is the minimum attribute required to uniquely
identify a tuple.
4. Alternate Key: - Out of all Candidate keys, Only one gets selected as primary key,
remaining Keys are known as alternative Keys.
In the above Table, Emp _id is the best suitable for primary key so rest of candidate key
(Email_id , Addhar_no) are considered as candidate key
5. Foreign Key :-
A key used to link two tables together.
An attribute or set of attributes in one table that refer to the primary key in another
table.
Foreign key is ensure (or maintain) referential integrity of the data.