×

Candidate Key in DBMS

Candidate key in DBMS: The candidate key is a single column or the set of columns that uniquely identifies the rows of data in the database table. It is a super key but with no repeated columns or attributes. So, this key is also called as minimal super key. Every table in the database must have at least a single candidate key.

Properties of Candidate key

Following are some of the properties of the candidate key:

  • A candidate may have more than one column or attribute.
  • The column, which is defined as the candidate key, will not contain any NULL value.
  • It uniquely identifies each row in the table of the database.
  • The values defined in the candidate key must be unique.
  • Those attributes or columns which visible in some candidate key are called as the prime attributes.

We are describing the candidate key using the following example, so you can easily understand it.

This example uses one table Employee, which contains three columns or fields or attributes. The name of these three columns is Employee_ID, Employee_Name, Employee_EmailID.

Employee_IDEmployee_NameEmployee_EmailID
201Anujabc@gmail.com
202Chetanxyz@gmail.com
203Lalitmn@gmail.com
204Lakshmanpqr@gmail.com
205Lalitdef@gmail.com

Now, we have to identify all the super key present in the table. After then, we have to eliminate the super keys, which contain the columns with duplicate attributes.

All the super keys of the Employee table are as follows:  

1. { Employee_ID}: This column will contain all the unique values; hence this column can be used as a candidate key.

2. {Employee_EmailID}: As no two employees have the same emailID, hence Employee_EmailID column can be used as a candidate key.  

3. { Employee_ID, Employee_EmailID }: As both ID and EmailID is unique for all the employees, this column combination can be a candidate key.

4. { Employee_ID, Employee_Name }: This column combination cannot be used as a candidate key because the two employees may have the same name.

5. { Employee_ID, Employee_Name, Employee_EmailID }: This column combination cannot be used as a candidate key because the Employee_name column may have duplicate values.

6. { Employee_Name, Employee_EmailID }: This column combination cannot be used as a candidate key because the Employee_name column may have duplicate values.

So, after elimination, following are the columns which can be the candidate key of the employee table:

{ Employee_ID},

{Employee_EmailID}, and

{ Employee_ID, Employee_EmailID }


Related Topics

What is Transaction in DBMS

A transaction is a collection of logically related operations which reads and possibly updates the various data items in the database. Usually, a transaction is initiated by a user program written in high-level...

3 minutes read.

Attributes in DBMS

What is Attribute? An attribute is an element in the database management system that describes the property or certain characteristics of the database entity. It is a crucial element of the...

3 minutes read.

Aggregate Functions in DBMS

Aggregate Functions in DBMS: Aggregate functions are those functions in the DBMS which takes the values of multiple rows of a single column and then form a single value by...

2 minutes read.

DBMS Architecture

This is the first step when creating a database management system. The architecture of a database management system plays an important role in determining the actual design and layout of...

4 minutes read.

DBMS View: Read, Update, Create and Drop

View in DBMS: The View is a logical or virtual table that allows users to view or manipulate parts of the table. View is also a table which consists of...

2 minutes read.

Data Models in DBMS

Data Models in DBMS Data models are the models explaining the logical structure of the database systems. They describe the entities, attributes, and the relationship among the data elements of the...

8 minutes read.

Components of DBMS

The database management system (DBMS) represents an essential tool for processing data within effectively structured structures. The database management system consists of important components that work together to maintain the...

6 minutes read.

DBMS Examples

Introduction to DBMS A database management system (DBMS) is a software application that is designed to manage and organize data stored in a database. It is responsible for storing, retrieving, and...

4 minutes read.

Components of an ER Diagram

An ER Diagram consists of the following components: Entity AttributesRelationships 1. Entity An entity may be an object, place, person, or an event which stores data in the database. In an entity-relationship diagram, an entity...

4 minutes read.

Levels of Abstraction in DBMS

Data abstraction is a way to hide unwanted or irrelevant information from the end user in DBMS. It helps in enhancing the security of data, and simplifies database design using...

4 minutes read.

Advantages of DBMS

A Database Management System (DBMS) is a collection of programs which lets the end-users to manage and control the database. Database systems use query language for accessing, storing, and maintaining the...

3 minutes read.

Schedule in DBMS

Schedule A sequence of statements that specify the sequential order in which the statements of concurrent transactions are executed. The transaction will get committed when it executes the instructions successfully without any...

4 minutes read.

Three Schema Architecture of DBMS

The three schema architecture describes how the data is represented or viewed by the user in the database. This architecture is also known as three-level architecture and is sometimes called...

3 minutes read.

DBMS Architecture

Architecture of Database Management System DBMS architecture helps in development, implementation, design, and maintenance of a database that store and organize information for agencies, businesses, and institutions. It is the base of any database...

2 minutes read.

Deadlock in DBMS

Deadlock in DBMS A deadlock is an unwanted condition in which two or more transaction are waiting indefinitely for one another to give up locks. It is said to be one of the...

3 minutes read.

3- Tier Architecture in DBMS

Three-tier architecture is an application software architecture that arranges the output into three parts or tiers that are:  the presentation tier, where the user interacts with the application; the application...

4 minutes read.

Difference between File System and DBMS

What is File Management System? A file management system is a collection of programs that manage and store data in files and folders in a computer hard disk. A file management...

9 minutes read.

ER Diagram of Company Database in DBMS

Entity Relationship Diagram Entity Relationship Diagrams, or ER Diagrams for short, are diagrams that show the relationships among entity sets that are stored in databases. Alternatively said, ER diagrams assist in...

3 minutes read.

Disadvantages of DBMS

Disadvantages of DBMS With the vast list of advantages, there are some following disadvantages or limitations of the database management system. 1. High Cost The high cost of software and hardware is the...

2 minutes read.

DBMS Generalization, Specialization, and Aggregation

DBMS Generalization Generalization is a bottom-up approach in which the common attributes of two or more lower-level entities combines to form a new higher-level entity. In generalization, the generalized entity of higher level can also...

3 minutes read.