SlideShare a Scribd company logo
1 of 13
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 (20)

Sql clauses by Manan Pasricha
Sql clauses by Manan PasrichaSql clauses by Manan Pasricha
Sql clauses by Manan Pasricha
 
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
 
Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NFNormalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
Data models
Data modelsData models
Data models
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
MySQL JOINS
MySQL JOINSMySQL JOINS
MySQL JOINS
 
Hash table
Hash tableHash table
Hash table
 
SQL Join Basic
SQL Join BasicSQL Join Basic
SQL Join Basic
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
Types of keys in database | SQL
Types of keys in database | SQLTypes of keys in database | SQL
Types of keys in database | SQL
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 

Similar to Keys in dbms (14)

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

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

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