SlideShare a Scribd company logo
2
Most read
3
Most read
Keys in DBMS
By:
Ankit Rai
Key
A key is a set of attributes that can identify each tuple uniquely in the given
relation.
Different Types Of Keys
 Super key
 Candidate key
 Primary key
 Alternate key
 Foreign key
 Composite key
 Unique key
 Secondary key
 Surrogate key
Super Key
A super key is a set of attributes that can identify each tuple uniquely in the
given relation.
A super key may consists of any number of attributes.
Candidate Key
A minimal super key is called as a candidate key.
The value of candidate key must always be unique and can never be NULL.
Primary Key
A primary key is a candidate key that the database designer selects while
designing the database.
The value of primary key must always be unique and can never be NULL.
Alternate Key
Candidate keys that are left unimplemented or unused after implementing the
key are called as alternate keys.
Foreign Key
An attribute ‘X’ is called as a foreign key to some other attribute ‘Y’ when its values
dependent on the values of attribute ‘Y’.
The relation in which attribute ‘Y’ is present is called as the referenced relation.
The relation in which attribute ‘Y’ is present is called as the referencing relation
Composite Key
A primary key comprising of multiple attributes and not just a single attribute is
as a composite key.
Unique key
It is unique for all the records of the table and may have a NULL value.
Once assigned, its value can not be changed i.e. it is non-updatable.
Surrogate Key
It is unique for all the records of the table and can not be NULL.
It is updatable.
Secondary Key
Secondary key is required for the indexing purpose for better and faster
searching.

More Related Content

PPTX
Types of Database Keys
PPTX
Database keys
PPTX
DBMS: Types of keys
PPTX
Types of keys dbms
PPTX
DBMS Keys
PPTX
Key and its different types
ODP
Relational keys
PPTX
Types of keys in database | SQL
Types of Database Keys
Database keys
DBMS: Types of keys
Types of keys dbms
DBMS Keys
Key and its different types
Relational keys
Types of keys in database | SQL

What's hot (20)

PPTX
Types Of Keys in DBMS
PPT
Database Keys
PDF
Natural vs.surrogate keys
PDF
XML Quick Reference (from mulberrytech.com)
PDF
Keys in Database
DOCX
Doc 20191022-wa0041
KEY
Serving Code Samples
PDF
PPTX
Database management system
PPT
2. html attributes
POTX
Introduction to php 3
DOCX
Default convention for entity framework code first
PDF
Natural Language Programming
PPT
Xml Presentation-3
PPTX
Xml basics
PPTX
Relational database intro for marketers
PPTX
Week1 xml
PPTX
Types Of Keys in DBMS
Database Keys
Natural vs.surrogate keys
XML Quick Reference (from mulberrytech.com)
Keys in Database
Doc 20191022-wa0041
Serving Code Samples
Database management system
2. html attributes
Introduction to php 3
Default convention for entity framework code first
Natural Language Programming
Xml Presentation-3
Xml basics
Relational database intro for marketers
Week1 xml
Ad

Similar to Keys in Database Management System (14)

PPTX
SQL_DBMS_KEYS.pptx
PPTX
Keys presentation
PPTX
Understanding Entity Relationship Models
PPTX
DBMS-Keys , Attributes and Constraints.pptx
PPTX
Types of keys in dbms
PPTX
Keys in DBMS.pptx
PPTX
Database manamement system_keys_sheikh_monirul_hasan
PPTX
key (1).pptx
PPTX
The Relational Database Model
PDF
DBMS_Keys.pdf
PPTX
Database_Keys types of keys in DBMS.pptx
PPT
Part 3 primary and foreign keys
DOCX
Keys used in database
PPT
Lecture 07 relational database management system
SQL_DBMS_KEYS.pptx
Keys presentation
Understanding Entity Relationship Models
DBMS-Keys , Attributes and Constraints.pptx
Types of keys in dbms
Keys in DBMS.pptx
Database manamement system_keys_sheikh_monirul_hasan
key (1).pptx
The Relational Database Model
DBMS_Keys.pdf
Database_Keys types of keys in DBMS.pptx
Part 3 primary and foreign keys
Keys used in database
Lecture 07 relational database management system
Ad

More from Ankit Rai (7)

PPTX
LLMs and Case Study: Evolution of ChatGPT.pptx
PPTX
SQL Joins.pptx
PPTX
Chapter Review Guide
PPTX
Inventory models
PPTX
IoT in Oil and Gas Industry
PPTX
Supervised Machine Learning
PPTX
Exception handling in Java
LLMs and Case Study: Evolution of ChatGPT.pptx
SQL Joins.pptx
Chapter Review Guide
Inventory models
IoT in Oil and Gas Industry
Supervised Machine Learning
Exception handling in Java

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Well-logging-methods_new................
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Lecture Notes Electrical Wiring System Components
PPT
Project quality management in manufacturing
PPTX
Sustainable Sites - Green Building Construction
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Digital Logic Computer Design lecture notes
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Geodesy 1.pptx...............................................
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Construction Project Organization Group 2.pptx
PPTX
Artificial Intelligence
OOP with Java - Java Introduction (Basics)
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Well-logging-methods_new................
CYBER-CRIMES AND SECURITY A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
Lecture Notes Electrical Wiring System Components
Project quality management in manufacturing
Sustainable Sites - Green Building Construction
Automation-in-Manufacturing-Chapter-Introduction.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Digital Logic Computer Design lecture notes
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Internet of Things (IOT) - A guide to understanding
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
CH1 Production IntroductoryConcepts.pptx
Geodesy 1.pptx...............................................
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Construction Project Organization Group 2.pptx
Artificial Intelligence

Keys in Database Management System

  • 2. Key A key is a set of attributes that can identify each tuple uniquely in the given relation. Different Types Of Keys  Super key  Candidate key  Primary key  Alternate key  Foreign key  Composite key  Unique key  Secondary key  Surrogate key
  • 3. Super Key A super key is a set of attributes that can identify each tuple uniquely in the given relation. A super key may consists of any number of attributes. Candidate Key A minimal super key is called as a candidate key. The value of candidate key must always be unique and can never be NULL. Primary Key A primary key is a candidate key that the database designer selects while designing the database. The value of primary key must always be unique and can never be NULL.
  • 4. Alternate Key Candidate keys that are left unimplemented or unused after implementing the key are called as alternate keys. Foreign Key An attribute ‘X’ is called as a foreign key to some other attribute ‘Y’ when its values dependent on the values of attribute ‘Y’. The relation in which attribute ‘Y’ is present is called as the referenced relation. The relation in which attribute ‘Y’ is present is called as the referencing relation Composite Key A primary key comprising of multiple attributes and not just a single attribute is as a composite key.
  • 5. Unique key It is unique for all the records of the table and may have a NULL value. Once assigned, its value can not be changed i.e. it is non-updatable. Surrogate Key It is unique for all the records of the table and can not be NULL. It is updatable. Secondary Key Secondary key is required for the indexing purpose for better and faster searching.