GEEKY BANKERS CAIIB (IT) Keys in DBMS Complete
GEEKY BANKERS CAIIB (IT) Keys in DBMS Complete
Geeky Bankers
CAIIB (IT)
Keys in DBMS
Join GEEKY BANKER on YouTube
CAIIB(IT)
Keys in DBMS
Super Key – A super key is a group of single or multiple attributes which uniquely
identifies rows in a table. A super key is a candidate key’s superset or in other word
candidate key is the subset of super key.
Super Keys:-
{EMP_ID} {EMP_ID,EMP_NAME}
{EMP_PAN} {EMP_PAN,EMP_NAME}
{EMP_MAIL} {EMP_ID,EMP_PAN,EMP_AGE}
{EMP_ID,EMP_AGE} {EMP_MAIL,EMP_PAN,EMP_NAME}
Join GEEKY BANKER on YouTube
Candidate Key: - A candidate key is an attribute or set of attributes that can uniquely
identify a tuple. Except for the primary key, the remaining attributes are considered a
candidate key. In a table, we select the primary key from a candidate key.
Primary Key: - Primary Key is an attribute or group of attribute in a table that can
uniquely identify every row in a table.
Unique Key:- A unique key is a set of one or more than one fields/columns of a table
that uniquely identify a record in a database table.
Primary key will not accept NULL values whereas Unique key can accept NULL values. A
table can have only one primary key whereas there can be multiple unique key on a table.
Foreign Key:- A foreign key is an attribute in a table that acts as the primary key in
another table. Hence, the foreign key is useful in linking together two tables.
Composite Key :- The composite key refers to a set of more than one
attributes that help us uniquely identify each tuple in a table. The attributes
present in a set may not be unique whenever we consider them separately.
Thus, when we take them all together, it will ensure uniqueness otherwise not.
Constraints in Database
There are several types of constraints available in DBMS and they are:
1. Domain constraints.
2. Entity Integrity constraints.
3. Referential Integrity constraints.
9835634545