Types of Keys in DBMS

A super key is any set of attributes that uniquely identifies a tuple in a relation. It can have redundant attributes.

Super Key

A minimal super key is called a candidate key. It uniquely identifies a tuple without any redundant attributes. A table can have multiple candidate keys.

Candidate Key

One of the candidate keys is chosen as the primary key to uniquely identify each row in a table. It cannot contain null values.

Primary Key

These keys are not chosen as the primary key are called alternate keys. They provide an alternative way to identify rows.

Alternate Key

It is a column in one table that refers to the primary key of another table It establishes a link between two tables.

Foreign Key

It is a combination of multiple columns that uniquely identifies a row in a table. It is used when a single column cannot guarantee uniqueness.

Composite Key

It ensures that all values in a column are different. This key is similar to a primary key but allows null values.

Unique Key