SlideShare a Scribd company logo
1 of 11
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 1
Types of Keys in Database System
Types of Keys
 Super Key
 Candidate Key
 Primary Key
 Alternate Key
 Composite Key
 Foreign Key
 Unique Key
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 2
Super Key
 An attribute or set of attributes that are required to identifies a
tuple in a relation.
 A Super Key may contain additional attributes that are not
require for unique identification.
 Unique Key-Student_ID
 Super Key:
 {Student_ ID, Student_Name}
 {Studenr_ID, Student_Address}
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 3
Candidate Key
 Candidate Keys are minimal set of Super Key
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 4
Primary Key
 Primary Key is a candidate key chosen by database administrator for
unique identification.
 No Two rows can have the primary key same values.
 Every row must have primary key value
 The primary key value can not be null
 Value in primary key can not be modified.
 Primary Key: PAN No.
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 5
Alternate Key
• Candidate keys other than primary key are called as a alternate
key.
• PK: PAN No.
• Alternate Key: Voter Id No, Passport No
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 6
Composite Key
• Composite key is the one having combination of more than one attribute
to uniquely determine the records/tuples in a table.
• The only condition that is necessary before choosing composite key is,
the attributes which are responsible for forming the composite key must
not be a key individually.
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 7
Foreign Key
• A foreign key is nothing but an attribute that is commonly linked between two
relation using that same attribute and that attribute must be primary key from one
relation.
• Both the relations/tables must contain the same attribute.
• It can be referred as referential integrity
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 8
Unique Key
 Unique key is same as primary key with the difference being
the existence of Null value.
 Unique Key: MemberID
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 9
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 10
All Keys
Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 11

More Related Content

What's hot (20)

Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
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
 
joins in database
 joins in database joins in database
joins in database
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
DBMS Integrity rule
DBMS Integrity ruleDBMS Integrity rule
DBMS Integrity rule
 
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
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level Architecture
 
Advantages of DBMS
Advantages of DBMSAdvantages of DBMS
Advantages of DBMS
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 

Similar to DBMS: Types of keys

Similar to DBMS: Types of keys (20)

SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
 
DBMS_Keys.pdf
DBMS_Keys.pdfDBMS_Keys.pdf
DBMS_Keys.pdf
 
Database keys
Database keysDatabase keys
Database keys
 
Keys used in database
Keys used in databaseKeys used in database
Keys used in database
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptx
 
Dbms keysppt
Dbms keyspptDbms keysppt
Dbms keysppt
 
Dbms keys
Dbms keysDbms keys
Dbms keys
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
 
Keys.pptx
Keys.pptxKeys.pptx
Keys.pptx
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Keys presentation
Keys presentationKeys presentation
Keys presentation
 
key.pptx
key.pptxkey.pptx
key.pptx
 
Types of keys dbms
Types of keys dbmsTypes of keys dbms
Types of keys dbms
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
 
DATA BASE KEYS.docx
DATA BASE KEYS.docxDATA BASE KEYS.docx
DATA BASE KEYS.docx
 

Recently uploaded

chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
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
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
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
 
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
 
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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Recently uploaded (20)

chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
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
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
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
 
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
 
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
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
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
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

DBMS: Types of keys

  • 2. Types of Keys  Super Key  Candidate Key  Primary Key  Alternate Key  Composite Key  Foreign Key  Unique Key Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 2
  • 3. Super Key  An attribute or set of attributes that are required to identifies a tuple in a relation.  A Super Key may contain additional attributes that are not require for unique identification.  Unique Key-Student_ID  Super Key:  {Student_ ID, Student_Name}  {Studenr_ID, Student_Address} Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 3
  • 4. Candidate Key  Candidate Keys are minimal set of Super Key Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 4
  • 5. Primary Key  Primary Key is a candidate key chosen by database administrator for unique identification.  No Two rows can have the primary key same values.  Every row must have primary key value  The primary key value can not be null  Value in primary key can not be modified.  Primary Key: PAN No. Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 5
  • 6. Alternate Key • Candidate keys other than primary key are called as a alternate key. • PK: PAN No. • Alternate Key: Voter Id No, Passport No Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 6
  • 7. Composite Key • Composite key is the one having combination of more than one attribute to uniquely determine the records/tuples in a table. • The only condition that is necessary before choosing composite key is, the attributes which are responsible for forming the composite key must not be a key individually. Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 7
  • 8. Foreign Key • A foreign key is nothing but an attribute that is commonly linked between two relation using that same attribute and that attribute must be primary key from one relation. • Both the relations/tables must contain the same attribute. • It can be referred as referential integrity Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 8
  • 9. Unique Key  Unique key is same as primary key with the difference being the existence of Null value.  Unique Key: MemberID Ms. B.K.Ugale(bharati_ugale@rediffmail.com) 9