×

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

Integrity Constraints in DBMS

Integrity constraints in DBMS (Database Management System) are used to ensure the accuracy and consistency of data in a database. They are a set of rules that define the allowed...

1 minute read.

Conflict Serializability in DBMS

Conflict Serializability A schedule is said to be conflict serializable if it can transform into a serial schedule after swapping of non-conflicting operations. It is a type of serializability that can be used...

3 minutes read.

B+ (Plus) Tree in DBMS

What is a B+ tree? The B+ tree is known as a balanced binary search tree. in this tree, we can store the data in the form of nodes. B+ tree...

9 minutes read.

View Serializability in DBMS

View Serializability It is a type of serializability that can be used to check whether the given schedule is view serializable or not. A schedule called as a view serializable if it is view...

4 minutes read.

Secondary Key in DBMS

What are Keys? Keys in DBMS are the attributes or set of attributes that uniquely identify a row in a set of relations. A table (relation) can have a column or...

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

ER Diagram for Banking System 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.

Advantages of RDBMS

The relational database management system collects related data stored in tabular format. The data is stored in rows and columns, where rows usually represent the individual entity of the collected...

6 minutes read.

Meta Data in DBMS

Metadata: Metadata is simply described as information about information. It indicates that the data is described as well as its context. It makes data easier to find, interpret, and organize. I'll...

4 minutes read.

Domain Constraints in DBMS

Introduction about DBMS:- DBMS stands for DataBase Management System. DBMS(DataBase Management System) is a type of software by which we can save and retrieve the user's data with the security process....

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

Relational Integrity Constraints

Relational Integrity Constraints are the set of rules that can be used to maintain the data integrity during an insert, delete and update operations into a table. These constraints are checked in the...

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

Generalization in DBMS

Generalization in DBMS In the database management system, generalization is a concept combining the common attributes of two or more lower-level entity and form a new higher level with the common...

3 minutes read.

ACID Properties in DBMS

A transaction in a database has the following four properties, known as ACID properties. These properties are used to maintain the consistency of the database in the case of system failure and concurrent...

4 minutes read.

Inference Rules

Armstrong’s axioms are the complete set of basic inference rules used to infer all the functional dependencies on the relational database. An inference rule is a type of assertion that a user can...

2 minutes read.

Defference between Database and Data Warehouse

Database A database is a collection of related information is called a database. It has some elements that can be mapped to real-world objects. It is designed in such a manner...

4 minutes read.

Advantages of B-Tree in DBMS

A self-balancing search tree is the B-Tree. It is assumed that everything is in the main memory in most other self-balancing search trees (such as AVL and Red-Black Trees). We must...

3 minutes read.

Why we need Distributed Database Management System

Assuming there is a very strong single machine having properties like: Heaps of memory.Gigantic measure of dependable stockpiling with very quick I/O.Incredible handling rate and processing power (10s, 100s and might...

4 minutes read.

Normalization in DBMS: 1NF, 2NF, 3NF, BCNF & 4NF with Examples

Normalization is a technique of organizing the data in the database. It is a systematic approach which is used to remove or reduce data redundancy in the tables and remove the...

7 minutes read.