Home

Types of Keys in DBMS

 

 

In the Relational Database Model, keys are important because they are used to ensure that each row in a table is uniquely identifiable. They are also used to establish relationships among tables and to ensure the integrity of the data.

 

Functional dependence:

The attribute B is functionally dependent on the attribute A if each value in column A determines one and only one value in column B.

Composite key:


A key may be composed of more than one attribute. Such a multi attribute key is known as a composite key.

Relational Database Keys:

 

Superkey: An attribute (or a combination of attributes) that uniquely identifies each row in a table.

Candidate key: A minimal (irreducible) superkey. A superkey that does not contain a subset of attributes that is itself a superkey.

Primary key: A candidate key selected to uniquely identify all other attribute values in any given row. Cannot contain null entries.

 


Secondary key: An attribute (or combination of attributes) used strictly for data retrieval purposes.

Foreign key: An attribute (or combination of attributes) in one table whose values must either match the primary key in another table or be null.

 

You may also like:

Basic Notations of ER diagram

Characterstics of Table

Integrity Rules in DBMS

Relational Set Operaotrs

Codd’s Relational Database Rules

Back to DBMS Questions