SlideShare a Scribd company logo
1 of 5
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

What's hot (20)

Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Database Keys
Database KeysDatabase Keys
Database Keys
 
Natural vs.surrogate keys
Natural vs.surrogate keysNatural vs.surrogate keys
Natural vs.surrogate keys
 
XML Quick Reference (from mulberrytech.com)
XML Quick Reference (from mulberrytech.com)XML Quick Reference (from mulberrytech.com)
XML Quick Reference (from mulberrytech.com)
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
 
XXE
XXEXXE
XXE
 
Xxe
XxeXxe
Xxe
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
Serving Code Samples
Serving Code SamplesServing Code Samples
Serving Code Samples
 
Plsqlobj
PlsqlobjPlsqlobj
Plsqlobj
 
Database management system
Database management systemDatabase management system
Database management system
 
2. html attributes
2. html attributes2. html attributes
2. html attributes
 
Introduction to php 3
Introduction to php   3Introduction to php   3
Introduction to php 3
 
Default convention for entity framework code first
Default convention for entity framework code firstDefault convention for entity framework code first
Default convention for entity framework code first
 
Natural Language Programming
Natural Language ProgrammingNatural Language Programming
Natural Language Programming
 
Xml Presentation-3
Xml Presentation-3Xml Presentation-3
Xml Presentation-3
 
Xml basics
Xml basicsXml basics
Xml basics
 
Relational database intro for marketers
Relational database intro for marketersRelational database intro for marketers
Relational database intro for marketers
 
Week1 xml
Week1 xmlWeek1 xml
Week1 xml
 
XML SCHEMAS
XML SCHEMASXML SCHEMAS
XML SCHEMAS
 

Similar to Keys in Database Management System

Keys presentation
Keys presentationKeys presentation
Keys presentationmubeenkiran
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship ModelsHamzaNadeem527928
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxsajinis5
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbmsdarshhingu
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptxRevathy V R
 
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasanDatabase manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasanSheikh Monirul Hasan
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptxKAnurag2
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 
Part 3 primary and foreign keys
Part 3 primary and foreign keysPart 3 primary and foreign keys
Part 3 primary and foreign keyshussan fatima
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management systememailharmeet
 

Similar to Keys in Database Management System (13)

SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
 
Keys presentation
Keys presentationKeys presentation
Keys presentation
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptx
 
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasanDatabase manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasan
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
DBMS_Keys.pdf
DBMS_Keys.pdfDBMS_Keys.pdf
DBMS_Keys.pdf
 
Part 3 primary and foreign keys
Part 3 primary and foreign keysPart 3 primary and foreign keys
Part 3 primary and foreign keys
 
Keys used in database
Keys used in databaseKeys used in database
Keys used in database
 
Lecture 07 relational database management system
Lecture 07 relational database management systemLecture 07 relational database management system
Lecture 07 relational database management system
 

More from Ankit Rai

SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptxAnkit Rai
 
Chapter Review Guide
Chapter Review GuideChapter Review Guide
Chapter Review GuideAnkit Rai
 
Inventory models
Inventory modelsInventory models
Inventory modelsAnkit Rai
 
IoT in Oil and Gas Industry
IoT in Oil and Gas IndustryIoT in Oil and Gas Industry
IoT in Oil and Gas IndustryAnkit Rai
 
Supervised Machine Learning
Supervised Machine LearningSupervised Machine Learning
Supervised Machine LearningAnkit Rai
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in JavaAnkit Rai
 

More from Ankit Rai (6)

SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
 
Chapter Review Guide
Chapter Review GuideChapter Review Guide
Chapter Review Guide
 
Inventory models
Inventory modelsInventory models
Inventory models
 
IoT in Oil and Gas Industry
IoT in Oil and Gas IndustryIoT in Oil and Gas Industry
IoT in Oil and Gas Industry
 
Supervised Machine Learning
Supervised Machine LearningSupervised Machine Learning
Supervised Machine Learning
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in Java
 

Recently uploaded

Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentBharaniDharan195623
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate productionChinnuNinan
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectssuserb6619e
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 

Recently uploaded (20)

Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managament
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
Crushers to screens in aggregate production
Crushers to screens in aggregate productionCrushers to screens in aggregate production
Crushers to screens in aggregate production
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in projectDM Pillar Training Manual.ppt will be useful in deploying TPM in project
DM Pillar Training Manual.ppt will be useful in deploying TPM in project
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 

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.