×

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

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.

ER Diagram for School Management System in DBMS

What is ER Diagram? An ERD, or entity relationship diagram, is a diagram that depicts the connections between a group of entities contained in a database. In other words, ER diagrams...

6 minutes read.

Difference between Relational and Non-Relational Databases

Databases have become an integral part of our lives, from powering big websites like Amazon and Netflix to everyday tasks like remembering our passwords. With such an indispensable role in...

7 minutes read.

What is Non-Relational Database

Databases can be sorted as either relational or non-relational. Non-relational data sets are now and again alluded to as "NoSQL," which represents Not Only SQL. The principal difference between these...

4 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.

Founder of DBMS

The first database management system was built to automate the business of the General Electric Company. It was built by a small group of programmers. The Integrated Data Store IDS...

4 minutes read.

Difference between Dropbox and Amazon Drive

What is Dropbox? It is a file organising company that is owned by the American Company Dropbox Inc. Itsheadquarters is situated in San Francisco, California, U.S. Dropbox offers personal cloud, client...

3 minutes read.

Characteristics of DBMS

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...

3 minutes read.

DBMS Schema

Schema It is a physical representation of data that appears in the database management system. In simple words, a schema is the structure of any database.It defines how the data is stored...

2 minutes read.

Trigger in DBMS

Trigger in DBMS: A trigger is a procedure of SQL statements, which is automatically fired when the DML statements are executed on the table of the database. Triggers are the...

3 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.

Difference between DBMS and RDBMS

Database Management System A DBMS is system software which is used to store and manage the data in the database. It was introduced in 1960 for storing the data or information. This system allows...

3 minutes read.

Components of Relational Database Management System

A relational database management system compromises various component. Tables, records, attributes, instances, schemas and keys together form a relational database. In this page, we will discuss each component of RDBMS in...

4 minutes read.

Network model in DBMS

Network model: The many-to-many relationship between the database constraints is represented hierarchically by the Network Model in DBMS. It is a straightforward and straightforward database model. Due to the Network Model...

4 minutes read.

ER Diagram for Student Management System in DBMS

Entity Relationship diagrams 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...

6 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.

What is a Cloud Database

Cloud computing is the process of commoditizing data storage and processing time using standardized technologies. Cloud databases are databases that are hosted on cloud computing platforms such as Salesforce, GoGrid,...

4 minutes read.

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.

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.

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.