SlideShare a Scribd company logo
Presented by
Shalini
Indroduction
What Is Keys?
*keys are very important part of
relational data base.
*they are used to establish and
identify relation between tables.
* they also ensure that each record
within a table can be uniquely identified by
combination of one or more fields within a
table.
DBMS has five types of keys in it and they
all has different functionality.
The keys are all follows:
*Super key
*Candidate key
*Primary key
*Foreign key
*Composite key
 Super key:
A super key is a set of ONE or MORE
columns(Attributes) to uniquely identify rows in a
table.
Examples:
 Super keys:
 Empssn
 Empnum
 Empssn,empna
me
 Empssn,num,na
me
 Empnum,name
Empssn Empnum Empname
9876540098 Ca05 Shana
9876543210 Ca06 Shalini
1234567890 Ca07 Bhavani
2143658709 Ca08 Suvathi
6543210987 Ca09 Nithya
Candidate key:
*A SUPER KEY with no
redundant attribute is known as
Candidate Key.
Candidate keys :
*Empssn
*Empnum
Empssn Empnum Empnam
e
98765400
98
Ca05 Shana
987654321
0
Ca06 Shalini
123456789
0
Ca07 Bhavani
214365870
9
Ca08 Suvathi
654321098
7
Ca09 Nithya
Primary key:
*A Primary key is a column
or set of columns in a table that
uniquely identifies tubels(rows) in
that table.
Example:
Empssn Empid Empnam
e
98765400
98
Ca05 Shana
98765432
10
Ca06 Shalini
12345678
90
Ca07 Bhavani
21436587
09
Ca08 Suvathi
65432109
87
Ca09 Nithya
Empssn Empnum Empnam
987654009
8
Ca01 Oviya
907856341
2
Ca02 Raiza
123456789
0
Ca03 Bindhu
543210987
6
Ca04 Kajal
654321098
7
Ca10 Pragya
Foreign key:
*Foreign key are column of a table
that points to the primary key of another table.
*They act as a cross reference
between tables.
Example:
emp 1 emp 2
Empssn Empid Empnam
e
98765400
98
Ca05 Shana
98765432
10
Ca06 Shalini
12345678
90
Ca07 Bhavani
21436587
09
Ca08 Suvathi
65432109
87
Ca09 Nithya
Empssn Empnum Empnam
987654009
8
Ca01 Oviya
907856341
2
Ca02 Raiza
123456789
0
Ca03 Bindhu
543210987
6
Ca04 Kajal
654321098
7
Ca10 Pragya
Composite key:
*A key that consists of more
than one atributes to uniquely identify rows(also
known as records or tubels)in a table is called
COMPOSITE KEY.
Example :
Empssn Empnum Empname
9876543210 Ca05 Shana
1234567890 Ca06 Shalini
9078534127 Ca07 Bhavani
2143658709 Ca08 Suvathi
5432109876 Ca09 Nithya

More Related Content

What's hot

SQL Commands
SQL Commands SQL Commands
SQL Commands
Sachidananda M H
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
VARSHAKUMARI49
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
PadamNepal1
 
Sql Constraints
Sql ConstraintsSql Constraints
Sql Constraints
I L0V3 CODING DR
 
Group By, Order By, and Aliases in SQL
Group By, Order By, and Aliases in SQLGroup By, Order By, and Aliases in SQL
Group By, Order By, and Aliases in SQL
MSB Academy
 
Database Keys
Database KeysDatabase Keys
Database Keys
Forrester High School
 
Database keys
Database keysDatabase keys
Database keys
Rahul Mishra
 
Slide 5 keys
Slide 5 keysSlide 5 keys
Slide 5 keys
Visakh V
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
Ehtisham Ali
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
Shishir Aryal
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
Nilt1234
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
Stewart Rogers
 
Database Keys & Relationship
Database Keys & RelationshipDatabase Keys & Relationship
Database Keys & Relationship
Bellal Hossain
 
Normal forms
Normal formsNormal forms
Normal forms
Samuel Igbanogu
 
oracle Sql constraint
oracle  Sql constraint oracle  Sql constraint
oracle Sql constraint home
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
Syed Zaid Irshad
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
Mohan Kumar.R
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
Knowledge Center Computer
 
DML Commands
DML CommandsDML Commands

What's hot (20)

SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Sql Constraints
Sql ConstraintsSql Constraints
Sql Constraints
 
Group By, Order By, and Aliases in SQL
Group By, Order By, and Aliases in SQLGroup By, Order By, and Aliases in SQL
Group By, Order By, and Aliases in SQL
 
Database Keys
Database KeysDatabase Keys
Database Keys
 
Database keys
Database keysDatabase keys
Database keys
 
Slide 5 keys
Slide 5 keysSlide 5 keys
Slide 5 keys
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
SQL Queries
SQL QueriesSQL Queries
SQL Queries
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Database Keys & Relationship
Database Keys & RelationshipDatabase Keys & Relationship
Database Keys & Relationship
 
Normal forms
Normal formsNormal forms
Normal forms
 
oracle Sql constraint
oracle  Sql constraint oracle  Sql constraint
oracle Sql constraint
 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
 
Retrieving data using the sql select statement
Retrieving data using the sql select statementRetrieving data using the sql select statement
Retrieving data using the sql select statement
 
SQL Functions and Operators
SQL Functions and OperatorsSQL Functions and Operators
SQL Functions and Operators
 
Sql and Sql commands
Sql and Sql commandsSql and Sql commands
Sql and Sql commands
 
DML Commands
DML CommandsDML Commands
DML Commands
 

Similar to Keys in dbms

SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
rahulsharma571283
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
university of Gujrat, pakistan
 
Dbms keysppt
Dbms keyspptDbms keysppt
Dbms keysppt
ArunakumariAkula1
 
Dbms keys
Dbms keysDbms keys
Dbms keys
RUpaliLohar
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
A. S. M. Shafi
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
KAnurag2
 
Keys used in database
Keys used in databaseKeys used in database
Keys used in database
university of Gujrat, pakistan
 
Keys presentation
Keys presentationKeys presentation
Keys presentation
mubeenkiran
 
DBMS_Keys.pdf
DBMS_Keys.pdfDBMS_Keys.pdf
DBMS_Keys.pdf
DianneParaase
 
Key in DatabaseManagementSystem_engineering.pptx
Key in DatabaseManagementSystem_engineering.pptxKey in DatabaseManagementSystem_engineering.pptx
Key in DatabaseManagementSystem_engineering.pptx
snehavenkatt27
 
key.pptx
key.pptxkey.pptx
key.pptx
laptophp39
 
Keys.pptx
Keys.pptxKeys.pptx
Keys.pptx
revathi s
 
DBMS Keys.pptx
DBMS Keys.pptxDBMS Keys.pptx
DBMS Keys.pptx
AryanGour1
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
rahulsharma571283
 

Similar to Keys in dbms (15)

SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
 
V35 keys-c
V35  keys-cV35  keys-c
V35 keys-c
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
Dbms keysppt
Dbms keyspptDbms keysppt
Dbms keysppt
 
Dbms keys
Dbms keysDbms keys
Dbms keys
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
 
Keys used in database
Keys used in databaseKeys used in database
Keys used in database
 
Keys presentation
Keys presentationKeys presentation
Keys presentation
 
DBMS_Keys.pdf
DBMS_Keys.pdfDBMS_Keys.pdf
DBMS_Keys.pdf
 
Key in DatabaseManagementSystem_engineering.pptx
Key in DatabaseManagementSystem_engineering.pptxKey in DatabaseManagementSystem_engineering.pptx
Key in DatabaseManagementSystem_engineering.pptx
 
key.pptx
key.pptxkey.pptx
key.pptx
 
Keys.pptx
Keys.pptxKeys.pptx
Keys.pptx
 
DBMS Keys.pptx
DBMS Keys.pptxDBMS Keys.pptx
DBMS Keys.pptx
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 

Keys in dbms

  • 2. Indroduction What Is Keys? *keys are very important part of relational data base. *they are used to establish and identify relation between tables. * they also ensure that each record within a table can be uniquely identified by combination of one or more fields within a table.
  • 3. DBMS has five types of keys in it and they all has different functionality. The keys are all follows: *Super key *Candidate key *Primary key *Foreign key *Composite key
  • 4.  Super key: A super key is a set of ONE or MORE columns(Attributes) to uniquely identify rows in a table.
  • 5. Examples:  Super keys:  Empssn  Empnum  Empssn,empna me  Empssn,num,na me  Empnum,name Empssn Empnum Empname 9876540098 Ca05 Shana 9876543210 Ca06 Shalini 1234567890 Ca07 Bhavani 2143658709 Ca08 Suvathi 6543210987 Ca09 Nithya
  • 6. Candidate key: *A SUPER KEY with no redundant attribute is known as Candidate Key.
  • 7. Candidate keys : *Empssn *Empnum Empssn Empnum Empnam e 98765400 98 Ca05 Shana 987654321 0 Ca06 Shalini 123456789 0 Ca07 Bhavani 214365870 9 Ca08 Suvathi 654321098 7 Ca09 Nithya
  • 8. Primary key: *A Primary key is a column or set of columns in a table that uniquely identifies tubels(rows) in that table.
  • 9. Example: Empssn Empid Empnam e 98765400 98 Ca05 Shana 98765432 10 Ca06 Shalini 12345678 90 Ca07 Bhavani 21436587 09 Ca08 Suvathi 65432109 87 Ca09 Nithya Empssn Empnum Empnam 987654009 8 Ca01 Oviya 907856341 2 Ca02 Raiza 123456789 0 Ca03 Bindhu 543210987 6 Ca04 Kajal 654321098 7 Ca10 Pragya
  • 10. Foreign key: *Foreign key are column of a table that points to the primary key of another table. *They act as a cross reference between tables.
  • 11. Example: emp 1 emp 2 Empssn Empid Empnam e 98765400 98 Ca05 Shana 98765432 10 Ca06 Shalini 12345678 90 Ca07 Bhavani 21436587 09 Ca08 Suvathi 65432109 87 Ca09 Nithya Empssn Empnum Empnam 987654009 8 Ca01 Oviya 907856341 2 Ca02 Raiza 123456789 0 Ca03 Bindhu 543210987 6 Ca04 Kajal 654321098 7 Ca10 Pragya
  • 12. Composite key: *A key that consists of more than one atributes to uniquely identify rows(also known as records or tubels)in a table is called COMPOSITE KEY.
  • 13. Example : Empssn Empnum Empname 9876543210 Ca05 Shana 1234567890 Ca06 Shalini 9078534127 Ca07 Bhavani 2143658709 Ca08 Suvathi 5432109876 Ca09 Nithya