SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

SQL Views
SQL ViewsSQL Views
SQL Views
baabtra.com - No. 1 supplier of quality freshers
 
3 Level Architecture
3 Level Architecture3 Level Architecture
3 Level Architecture
Adeel Rasheed
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
madhav bansal
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
Dashani Rajapaksha
 
Queue ppt
Queue pptQueue ppt
Queue ppt
SouravKumar328
 
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
BIT Durg
 
Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
basic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptxbasic structure of SQL FINAL.pptx
basic structure of SQL FINAL.pptx
Anusha sivakumar
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
Saranya Natarajan
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
Arrays
ArraysArrays
Arrays
SARITHA REDDY
 
1.4 data independence
1.4 data independence1.4 data independence
1.4 data independence
BHARATH KUMAR
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
Anusha sivakumar
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
Nimrakhan89
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
Vigneshwaran Sankaran
 
Relational algebra in dbms
Relational algebra in dbmsRelational algebra in dbms
Relational algebra in dbms
Vignesh Saravanan
 
Terminology of tree
Terminology of treeTerminology of tree
Terminology of tree
RacksaviR
 

Similar to DBMS: Types of keys (20)

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
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
KAnurag2
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
HamzaNadeem527928
 
DBMS_Keys.pdf
DBMS_Keys.pdfDBMS_Keys.pdf
DBMS_Keys.pdf
DianneParaase
 
Database keys
Database keysDatabase keys
Database keys
Rahul Mishra
 
Keys used in database
Keys used in databaseKeys used in database
Keys used in database
university of Gujrat, pakistan
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptx
Revathy V R
 
Dbms keysppt
Dbms keyspptDbms keysppt
Dbms keysppt
ArunakumariAkula1
 
Dbms keys
Dbms keysDbms keys
Dbms keys
RUpaliLohar
 
5. relational structure
5. relational structure5. relational structure
5. relational structure
khoahuy82
 
Keys.pptx
Keys.pptxKeys.pptx
Keys.pptx
revathi s
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
A. S. M. Shafi
 
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILAKeys_in_DBMS_VALID_INFORMATION_IS_AVAILA
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
prashantkori7
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
rahulsharma571283
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
Shishir Aryal
 
Keys presentation
Keys presentationKeys presentation
Keys presentation
mubeenkiran
 
key.pptx
key.pptxkey.pptx
key.pptx
laptophp39
 
Types of keys dbms
Types of keys dbmsTypes of keys dbms
Types of keys dbms
Surkhab Shelly
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
sajinis5
 
Ad

Recently uploaded (20)

Building-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdfBuilding-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdf
Lawrence Omai
 
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
JRR Tolkien’s Lord of the Rings: Was It Influenced by Nordic Mythology, Homer...
Reflections on Morality, Philosophy, and History
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Analog electronic circuits with some imp
Analog electronic circuits with some impAnalog electronic circuits with some imp
Analog electronic circuits with some imp
KarthikTG7
 
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Prediction of Flexural Strength of Concrete Produced by Using Pozzolanic Mate...
Journal of Soft Computing in Civil Engineering
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
A Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptxA Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptx
rutujabhaskarraopati
 
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Guru
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
Taqyea
 
Building-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdfBuilding-Services-Introduction-Notes.pdf
Building-Services-Introduction-Notes.pdf
Lawrence Omai
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Analog electronic circuits with some imp
Analog electronic circuits with some impAnalog electronic circuits with some imp
Analog electronic circuits with some imp
KarthikTG7
 
Routing Riverdale - A New Bus Connection
Routing Riverdale - A New Bus ConnectionRouting Riverdale - A New Bus Connection
Routing Riverdale - A New Bus Connection
jzb7232
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
Slide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptxSlide share PPT of SOx control technologies.pptx
Slide share PPT of SOx control technologies.pptx
vvsasane
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Machine foundation notes for civil engineering students
Machine foundation notes for civil engineering studentsMachine foundation notes for civil engineering students
Machine foundation notes for civil engineering students
DYPCET
 
A Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptxA Survey of Personalized Large Language Models.pptx
A Survey of Personalized Large Language Models.pptx
rutujabhaskarraopati
 
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdfPRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Academy - Functional Modeling In Action with PRIZ.pdf
PRIZ Guru
 
Agents chapter of Artificial intelligence
Agents chapter of Artificial intelligenceAgents chapter of Artificial intelligence
Agents chapter of Artificial intelligence
DebdeepMukherjee9
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
SICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introductionSICPA: Fabien Keller - background introduction
SICPA: Fabien Keller - background introduction
fabienklr
 
Dynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptxDynamics of Structures with Uncertain Properties.pptx
Dynamics of Structures with Uncertain Properties.pptx
University of Glasgow
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
Taqyea
 
Ad

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
  翻译: