SlideShare a Scribd company logo
1 of 10
Download to read offline
Dr.M.Pyingkodi,MCA Dept,Kongu
Engineering College,Tamilnadu
An attribute or set of attributes which helps
you to identify a row(tuple) in a
relation(table).
to find the relation between two tables.
uniquely identify a row in a table by a
combination of one or more columns in that
table.
finding unique record or row from the table.
Dr.M.Pyingkodi,MCA Dept, Kongu Engineering College, Tamilnadu
EmployeeID is key
employee ID is a primary key because it uniquely
identifies an employee record.
no other employee can have the same employee ID.
Employee ID FirstName LastName
11 Andrew Johnson
22 Tom Wood
33 Alex Hale
Dr.M.Pyingkodi,MCA Dept, Kongu Engineering College, Tamilnadu
Super Key
a group of single or multiple keys which identifies rows in a table.
Primary Key
is a column or group of columns in a table that uniquely identify every row in that table.
Candidate Key
is a set of attributes that uniquely identify tuples in a table. Candidate Key is a
super key with no repeated attributes.
Select from the superkey
Alternate Key
is a column or group of columns in a table that uniquely identify every row in that table.
Foreign Key
is a column that creates a relationship between two tables. The purpose of Foreign keys is
to maintain data integrity and allow navigation between two different instances of an
entity.
Dr.M.Pyingkodi,MCA Dept,Kongu Engineering College,Tamilnadu
To identify any row of data in a table.
In a real-world application, a table could contain thousands of
records. Moreover, the records could be duplicated. Keys
ensure that you can uniquely identify a table record despite
these challenges.
Allows you to establish a relationship between and
identify the relation between tables
Help you to enforce identity and integrity in the
relationship.
Dr.M.Pyingkodi,MCA Dept, Kongu Engineering College, Tamilnadu
The remaining attributes except for primary key are considered as a candidate key. The
candidate keys are as strong as the primary key.
Dr.M.Pyingkodi, MCA Dept, Kongu Engineering College, Tamilnadu
Stud
ent_I
D
Student
_Enroll
Studen
t_Name
Student_Email
S02 4545 Ram Ram@gmail.com
S34 4541 Sam Sam@gmail.com
S22 4555 Tam Tam@gmail.com
{Student_ID}
{Student_Enroll}
{Student_Email}
{Student_ID, Student_Enroll}
{Studet_ID, Student_Name}
{Student_ID, Student_Email}
{Student_Name, Student_Enroll}
{Student_ID, Student_Enroll, Student_Name}
{Student_ID, Student_Enroll, Student_Email}
{Student_ID, Student_Enroll, Student_Name,
Student_Email}
{Student_ID}
{Student_Enroll}
{Student_Email}
The following would be the candidate key from the above
• Each table has only a single primary key.
• Each relation may have one or more candidate key.
One of these candidate key is called Primary Key.
• Each candidate key qualifies for Primary Key.
• Therefore candidates for Primary Key is called
Candidate Key.
• Candidate key can be a single column or combination
of more than one column.
• A minimal super key is called a candidate key.
Student_ID, Student_Enroll and Student_Email are the
candidate keys. They are considered candidate keys since
they can uniquely identify the student record.
Dr.M.Pyingkodi, MCA Dept, Kongu Engineering College, Tamilnadu
• Foreign keys are the column of the table which is
used to point to the primary key of another table.
• In a company, every employee works in a specific
department, and employee and department are two
different entities.
• So we can't store the information of the department
in the employee table.
• That's why we link these two tables through the
primary key of one table.
• We add the primary key of the DEPARTMENT table,
Department_Id as a new attribute in the EMPLOYEE
table.
Alternate Key or Secondary Key is the key that
has not been selected to be the primary key,
but are candidate keys.
It is considered a candidate key for the primary
key.
A candidate key not selected as a primary key is
called alternate or secondary key.
Student_ID as primary key,
therefore Student_Enroll and Student_Email
will be Alternate Key (candidates of primary
key).
• Foreign keys are the column of the table which is
used to point to the primary key of another table.
• In a company, every employee works in a specific
department, and employee and department are two
different entities. So we can't store the information
of the department in the employee table. That's
why we link these two tables through the primary
key of one table.
• We add the primary key of the DEPARTMENT table,
Department_Id as a new attribute in the EMPLOYEE
table.
Dr.M.Pyingkodi,MCA Dept,Kongu
Engineering College,Tamilnadu

More Related Content

What's hot (20)

Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
MYSQL join
MYSQL joinMYSQL join
MYSQL join
 
Servidor apache
Servidor apacheServidor apache
Servidor apache
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Ddl & dml commands
Ddl & dml commandsDdl & dml commands
Ddl & dml commands
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
ER Diagram
ER DiagramER Diagram
ER Diagram
 
File systems versus a dbms
File systems versus a dbmsFile systems versus a dbms
File systems versus a dbms
 
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joins
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
Creating a database
Creating a databaseCreating a database
Creating a database
 
SQL
SQLSQL
SQL
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
06.01 sql select distinct
06.01 sql select distinct06.01 sql select distinct
06.01 sql select distinct
 
Structured query language(sql)ppt
Structured query language(sql)pptStructured query language(sql)ppt
Structured query language(sql)ppt
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
 

Similar to Dbms keys (20)

Presentation OF DBMS-2.pptx
Presentation OF DBMS-2.pptxPresentation OF DBMS-2.pptx
Presentation OF DBMS-2.pptx
 
ISDD Database Keys N5
ISDD Database Keys N5ISDD Database Keys N5
ISDD Database Keys N5
 
Types of keys in database | SQL
Types of keys in database | SQLTypes of keys in database | SQL
Types of keys in database | SQL
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Dbms keys
Dbms keysDbms keys
Dbms keys
 
2.2 keys
2.2 keys2.2 keys
2.2 keys
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
FD.pdf
FD.pdfFD.pdf
FD.pdf
 
B & c
B & cB & c
B & c
 
Module 2 dbms.pptx
Module 2 dbms.pptxModule 2 dbms.pptx
Module 2 dbms.pptx
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
DEE 431 Database keys and Normalisation Slide 2
DEE 431 Database keys and Normalisation Slide 2DEE 431 Database keys and Normalisation Slide 2
DEE 431 Database keys and Normalisation Slide 2
 
Database design
Database designDatabase design
Database design
 
Database design
Database designDatabase design
Database design
 
Relational Model
Relational ModelRelational Model
Relational Model
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Keys.pptx
Keys.pptxKeys.pptx
Keys.pptx
 

More from pyingkodi maran

Essential concepts for machine learning
Essential concepts for machine learning Essential concepts for machine learning
Essential concepts for machine learning pyingkodi maran
 
Data preprocessing in Machine learning
Data preprocessing in Machine learning Data preprocessing in Machine learning
Data preprocessing in Machine learning pyingkodi maran
 
Introduction to Android Programming by Dr.M.Pyingkodi-kongu engineering c...
Introduction to  Android   Programming by  Dr.M.Pyingkodi-kongu engineering c...Introduction to  Android   Programming by  Dr.M.Pyingkodi-kongu engineering c...
Introduction to Android Programming by Dr.M.Pyingkodi-kongu engineering c...pyingkodi maran
 
Simple PHP programs by kongu Engineering College
Simple  PHP programs by  kongu  Engineering CollegeSimple  PHP programs by  kongu  Engineering College
Simple PHP programs by kongu Engineering Collegepyingkodi maran
 

More from pyingkodi maran (9)

Number systems
Number systemsNumber systems
Number systems
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Essential concepts for machine learning
Essential concepts for machine learning Essential concepts for machine learning
Essential concepts for machine learning
 
Sub Queries in oracle
Sub Queries in oracleSub Queries in oracle
Sub Queries in oracle
 
Android sensor
Android sensorAndroid sensor
Android sensor
 
Data preprocessing in Machine learning
Data preprocessing in Machine learning Data preprocessing in Machine learning
Data preprocessing in Machine learning
 
Introduction to Android Programming by Dr.M.Pyingkodi-kongu engineering c...
Introduction to  Android   Programming by  Dr.M.Pyingkodi-kongu engineering c...Introduction to  Android   Programming by  Dr.M.Pyingkodi-kongu engineering c...
Introduction to Android Programming by Dr.M.Pyingkodi-kongu engineering c...
 
Php mail program
Php mail programPhp mail program
Php mail program
 
Simple PHP programs by kongu Engineering College
Simple  PHP programs by  kongu  Engineering CollegeSimple  PHP programs by  kongu  Engineering College
Simple PHP programs by kongu Engineering College
 

Recently uploaded

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
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
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
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
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 

Recently uploaded (20)

Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
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
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
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
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
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
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
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...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
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
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 

Dbms keys

  • 2. An attribute or set of attributes which helps you to identify a row(tuple) in a relation(table). to find the relation between two tables. uniquely identify a row in a table by a combination of one or more columns in that table. finding unique record or row from the table. Dr.M.Pyingkodi,MCA Dept, Kongu Engineering College, Tamilnadu
  • 3. EmployeeID is key employee ID is a primary key because it uniquely identifies an employee record. no other employee can have the same employee ID. Employee ID FirstName LastName 11 Andrew Johnson 22 Tom Wood 33 Alex Hale Dr.M.Pyingkodi,MCA Dept, Kongu Engineering College, Tamilnadu
  • 4. Super Key a group of single or multiple keys which identifies rows in a table. Primary Key is a column or group of columns in a table that uniquely identify every row in that table. Candidate Key is a set of attributes that uniquely identify tuples in a table. Candidate Key is a super key with no repeated attributes. Select from the superkey Alternate Key is a column or group of columns in a table that uniquely identify every row in that table. Foreign Key is a column that creates a relationship between two tables. The purpose of Foreign keys is to maintain data integrity and allow navigation between two different instances of an entity. Dr.M.Pyingkodi,MCA Dept,Kongu Engineering College,Tamilnadu
  • 5. To identify any row of data in a table. In a real-world application, a table could contain thousands of records. Moreover, the records could be duplicated. Keys ensure that you can uniquely identify a table record despite these challenges. Allows you to establish a relationship between and identify the relation between tables Help you to enforce identity and integrity in the relationship. Dr.M.Pyingkodi,MCA Dept, Kongu Engineering College, Tamilnadu
  • 6. The remaining attributes except for primary key are considered as a candidate key. The candidate keys are as strong as the primary key. Dr.M.Pyingkodi, MCA Dept, Kongu Engineering College, Tamilnadu Stud ent_I D Student _Enroll Studen t_Name Student_Email S02 4545 Ram Ram@gmail.com S34 4541 Sam Sam@gmail.com S22 4555 Tam Tam@gmail.com {Student_ID} {Student_Enroll} {Student_Email} {Student_ID, Student_Enroll} {Studet_ID, Student_Name} {Student_ID, Student_Email} {Student_Name, Student_Enroll} {Student_ID, Student_Enroll, Student_Name} {Student_ID, Student_Enroll, Student_Email} {Student_ID, Student_Enroll, Student_Name, Student_Email} {Student_ID} {Student_Enroll} {Student_Email} The following would be the candidate key from the above
  • 7. • Each table has only a single primary key. • Each relation may have one or more candidate key. One of these candidate key is called Primary Key. • Each candidate key qualifies for Primary Key. • Therefore candidates for Primary Key is called Candidate Key. • Candidate key can be a single column or combination of more than one column. • A minimal super key is called a candidate key. Student_ID, Student_Enroll and Student_Email are the candidate keys. They are considered candidate keys since they can uniquely identify the student record. Dr.M.Pyingkodi, MCA Dept, Kongu Engineering College, Tamilnadu
  • 8. • Foreign keys are the column of the table which is used to point to the primary key of another table. • In a company, every employee works in a specific department, and employee and department are two different entities. • So we can't store the information of the department in the employee table. • That's why we link these two tables through the primary key of one table. • We add the primary key of the DEPARTMENT table, Department_Id as a new attribute in the EMPLOYEE table.
  • 9. Alternate Key or Secondary Key is the key that has not been selected to be the primary key, but are candidate keys. It is considered a candidate key for the primary key. A candidate key not selected as a primary key is called alternate or secondary key. Student_ID as primary key, therefore Student_Enroll and Student_Email will be Alternate Key (candidates of primary key).
  • 10. • Foreign keys are the column of the table which is used to point to the primary key of another table. • In a company, every employee works in a specific department, and employee and department are two different entities. So we can't store the information of the department in the employee table. That's why we link these two tables through the primary key of one table. • We add the primary key of the DEPARTMENT table, Department_Id as a new attribute in the EMPLOYEE table. Dr.M.Pyingkodi,MCA Dept,Kongu Engineering College,Tamilnadu