SlideShare una empresa de Scribd logo
1 de 11
“Concept of Keys in Data Base Management System (DBMS)”
Presented By
Deependra Kumar Shukla
For the Post of Assistant Professor in the Department of Computer Science
Pandit S. N. Shukla University, Shahdol, Madhya Pradesh-484001
Educational qualification:
• Ph.D. (CS) (Persuing).
• M.Tech. (CS).
• B.E. (IT).
• GATE-2017 with AIR-1972
• UGC - NET and JRF- December-2018
Concept of Keys in Data Base Management System (DBMS)
Table of Contents
Concept of Keys in Data Base Management System (DBMS)
• Super key or Key
• Candidate key
• Primary key
• Alternate key
• Composite key
• Foreign key
• Q&A
Super Key
Concept of Keys in Data Base Management System (DBMS)
Definition: A non-empty set of attributes of a relation (table) is said to be Super key if it is able to
uniquely identify all the Record or Tuple of that table.
(एक या एक से अधिक ऐधरि ब्यूर्स का समूह जो डाराबेस रेबल क
े प्रत्येक Record को अलग – अलग
पहचानने में सक्षम हो उसे Super key कहते है|)
For example: Table1
Values of a Super key
is always unique but it
may be “NULL” also.
Super keys of table1 are: {(Sid), (Sid, Name), (Sid, Course), (Sid, Name, Course)}
Sid Name Course
1 Manish BCA
2 Manish MCA
3 Raghav BCA
4 Ritik MCA
5 Nidhi BE
6 Ritik MCA
Super Key
Concept of Keys in Data Base Management System (DBMS)
Another examples are: Table2
Super keys of table 2 are: {(A,B)}.
Table3
Super key of table3 are : {(C),(A,B),(A,C),(B,C), (A,B,C)}
A B
1 2
2 8
1 3
4 2
5 3
A B C
1 2 1
2 8 2
1 3 3
4 2 4
5 3 5
Candidate Key
Concept of Keys in Data Base Management System (DBMS)
Definition: A minimal super key is known as Candidate key.
Or
A super key is said to be candidate key if its proper subset is not a key itself.
(ऐसी super-key धजसका कोई भी प्रॉपर सबसेर अपने-आप में key ना हो उसे Candidate-key कहते हैं|)
For example:
Super keys of the table1 are: {(Sid), (Sid, Name),(Sid, Course),(Sid, Name, Course)} then
• Here, Sid is a candidate-key because its proper subset is not a key.
• (Sid, Name),(Sid, Course),(Sid, Name, Course) are not the candidate key because all of
these has a proper subset Sid which is a key itself.
Note: Candidate key satisfy “unique” constraint but not “NULL” constraint.
Candidate Key
Concept of Keys in Data Base Management System (DBMS)
Another examples are:
Super keys of table 2 is: {(A,B)}
• Here proper subset A and B is not a key in itself, therefore AB is a candidate key.
Super key of table3 are : {(C),(A,B),(A,C),(B,C), (A,B,C)}
• C is a candidate key because its proper-subset is not a key.
• (A,B) is a candidate key because its proper subset A and B is not a key.
• (A,C),(B,C), (A,B,C) are not the candidate key because C is one of the proper subset of all
these keys and C itself is a key.
Primary Key
Concept of Keys in Data Base Management System (DBMS)
Definition: A Candidate key with no null values is said to be primary key. Every relation
(Table) must have a primary key.
(ऐसी Candidate-key धजसमे “Null” values नहीीं होती उसे Primary-key कहते हैं| प्रत्येक डाराबेस रेबल
में एक Primary key अधनवायय होती है|)
For example:
• Candidate key of the table1 is Sid. If we apply here not null constraints then it become the
Primary key.
• Candidate key of table 2 is {(A,B)}. If we apply here not null constraints then it becomes the
Primary key.
• Candidate key of table3 are : {(C), (A,B)} Here, either (C) or (AB) can be made as primary key
with not null constraints. Because in a database table only one primary key is possible.
Note: Primary key satisfy both “unique” and “NULL” constraint.
Alternate Key & Composite Key
Concept of Keys in Data Base Management System (DBMS)
Definition: Those Candidate keys which are not primary key are called as Alternate keys.
(ऐसी Candidate-key जो Primary-key नहीीं होती उन्हें Alternate-keys कहते हैं|)
For example:
• Candidate key of table3 are : {(C), (A,B)}Here, if we make C as primary key then (A,B)
becomes the alternate key and vice-versa.
• In table1 and table2 there will be no alternate key because only one candidate key is there.
Note: Alternate key satisfy “unique” constraint but not “NULL” constraint.
Composite Key: If a key contains more than one attribute then it is called as composite key.
For example:
• Key (A,B) contains two attributes A and B therefore it is called as Composite key.
Foreign Key
Concept of Keys in Data Base Management System (DBMS)
Definition: A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the
PRIMARY KEY in another table. The table with the foreign key is called the child table, and
the table with the primary key is called the referenced or parent table.
(Child table का वह attribute जो पैरेंर रेबल की Primary key को refer करता है foreign key कहलाता
है|)
For example: Let us examine the following student and Department table.
Note: Foreign key does not satisfy both “unique” and “NULL” constraint.
Summary
Concept of Keys in Data Base Management System (DBMS)
Set of Super Keys
Super key follows only “Unique” constraints but not “Not Null”
Set of Candidate Key
Candidate key follows only “Unique” constraints but not “Not Null”
Set of Alternate Key
Alternate key follows only “Unique” constraints but not “Not Null”
Primary Key
It follows both “Unique” and “Not null” constraints
If a Key has more than one
attributes ten it is called composite
key
Foreign key is used for
referential integrity.
Thank you for your attention
Concept of Keys in Data Base Management System (DBMS)
Q & A...
Thank you.

Más contenido relacionado

Similar a Concept of Keys in DBMS.pptx

Keys presentation
Keys presentationKeys presentation
Keys presentationmubeenkiran
 
2.2 keys
2.2 keys2.2 keys
2.2 keysELIMENG
 
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 2YOGESH SINGH
 
Complete SQL Tutorial In Hindi By Rishabh Mishra.pdf
Complete SQL Tutorial In Hindi By Rishabh Mishra.pdfComplete SQL Tutorial In Hindi By Rishabh Mishra.pdf
Complete SQL Tutorial In Hindi By Rishabh Mishra.pdfssuserb5bb0e
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database ModelsPrithwis Mukerjee
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database ModelsPrithwis Mukerjee
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbmsdarshhingu
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009Cathie101
 
Sql ch 12 - creating database
Sql ch 12 - creating databaseSql ch 12 - creating database
Sql ch 12 - creating databaseMukesh Tekwani
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMSPadamNepal1
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptxKAnurag2
 

Similar a Concept of Keys in DBMS.pptx (20)

Types of keys dbms
Types of keys dbmsTypes of keys dbms
Types of keys dbms
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
Keys presentation
Keys presentationKeys presentation
Keys presentation
 
key.pptx
key.pptxkey.pptx
key.pptx
 
2.2 keys
2.2 keys2.2 keys
2.2 keys
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptx
 
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
 
Complete SQL Tutorial In Hindi By Rishabh Mishra.pdf
Complete SQL Tutorial In Hindi By Rishabh Mishra.pdfComplete SQL Tutorial In Hindi By Rishabh Mishra.pdf
Complete SQL Tutorial In Hindi By Rishabh Mishra.pdf
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database Models
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database Models
 
Unit03 dbms
Unit03 dbmsUnit03 dbms
Unit03 dbms
 
Unit03 dbms
Unit03 dbmsUnit03 dbms
Unit03 dbms
 
Dbms keysppt
Dbms keyspptDbms keysppt
Dbms keysppt
 
Database intro
Database introDatabase intro
Database intro
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
Database Design Fdd 2009
Database Design Fdd 2009Database Design Fdd 2009
Database Design Fdd 2009
 
Sql ch 12 - creating database
Sql ch 12 - creating databaseSql ch 12 - creating database
Sql ch 12 - creating database
 
computer-210809080138.pdf
computer-210809080138.pdfcomputer-210809080138.pdf
computer-210809080138.pdf
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
 

Último

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Último (20)

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 

Concept of Keys in DBMS.pptx

  • 1. “Concept of Keys in Data Base Management System (DBMS)” Presented By Deependra Kumar Shukla For the Post of Assistant Professor in the Department of Computer Science Pandit S. N. Shukla University, Shahdol, Madhya Pradesh-484001 Educational qualification: • Ph.D. (CS) (Persuing). • M.Tech. (CS). • B.E. (IT). • GATE-2017 with AIR-1972 • UGC - NET and JRF- December-2018 Concept of Keys in Data Base Management System (DBMS)
  • 2. Table of Contents Concept of Keys in Data Base Management System (DBMS) • Super key or Key • Candidate key • Primary key • Alternate key • Composite key • Foreign key • Q&A
  • 3. Super Key Concept of Keys in Data Base Management System (DBMS) Definition: A non-empty set of attributes of a relation (table) is said to be Super key if it is able to uniquely identify all the Record or Tuple of that table. (एक या एक से अधिक ऐधरि ब्यूर्स का समूह जो डाराबेस रेबल क े प्रत्येक Record को अलग – अलग पहचानने में सक्षम हो उसे Super key कहते है|) For example: Table1 Values of a Super key is always unique but it may be “NULL” also. Super keys of table1 are: {(Sid), (Sid, Name), (Sid, Course), (Sid, Name, Course)} Sid Name Course 1 Manish BCA 2 Manish MCA 3 Raghav BCA 4 Ritik MCA 5 Nidhi BE 6 Ritik MCA
  • 4. Super Key Concept of Keys in Data Base Management System (DBMS) Another examples are: Table2 Super keys of table 2 are: {(A,B)}. Table3 Super key of table3 are : {(C),(A,B),(A,C),(B,C), (A,B,C)} A B 1 2 2 8 1 3 4 2 5 3 A B C 1 2 1 2 8 2 1 3 3 4 2 4 5 3 5
  • 5. Candidate Key Concept of Keys in Data Base Management System (DBMS) Definition: A minimal super key is known as Candidate key. Or A super key is said to be candidate key if its proper subset is not a key itself. (ऐसी super-key धजसका कोई भी प्रॉपर सबसेर अपने-आप में key ना हो उसे Candidate-key कहते हैं|) For example: Super keys of the table1 are: {(Sid), (Sid, Name),(Sid, Course),(Sid, Name, Course)} then • Here, Sid is a candidate-key because its proper subset is not a key. • (Sid, Name),(Sid, Course),(Sid, Name, Course) are not the candidate key because all of these has a proper subset Sid which is a key itself. Note: Candidate key satisfy “unique” constraint but not “NULL” constraint.
  • 6. Candidate Key Concept of Keys in Data Base Management System (DBMS) Another examples are: Super keys of table 2 is: {(A,B)} • Here proper subset A and B is not a key in itself, therefore AB is a candidate key. Super key of table3 are : {(C),(A,B),(A,C),(B,C), (A,B,C)} • C is a candidate key because its proper-subset is not a key. • (A,B) is a candidate key because its proper subset A and B is not a key. • (A,C),(B,C), (A,B,C) are not the candidate key because C is one of the proper subset of all these keys and C itself is a key.
  • 7. Primary Key Concept of Keys in Data Base Management System (DBMS) Definition: A Candidate key with no null values is said to be primary key. Every relation (Table) must have a primary key. (ऐसी Candidate-key धजसमे “Null” values नहीीं होती उसे Primary-key कहते हैं| प्रत्येक डाराबेस रेबल में एक Primary key अधनवायय होती है|) For example: • Candidate key of the table1 is Sid. If we apply here not null constraints then it become the Primary key. • Candidate key of table 2 is {(A,B)}. If we apply here not null constraints then it becomes the Primary key. • Candidate key of table3 are : {(C), (A,B)} Here, either (C) or (AB) can be made as primary key with not null constraints. Because in a database table only one primary key is possible. Note: Primary key satisfy both “unique” and “NULL” constraint.
  • 8. Alternate Key & Composite Key Concept of Keys in Data Base Management System (DBMS) Definition: Those Candidate keys which are not primary key are called as Alternate keys. (ऐसी Candidate-key जो Primary-key नहीीं होती उन्हें Alternate-keys कहते हैं|) For example: • Candidate key of table3 are : {(C), (A,B)}Here, if we make C as primary key then (A,B) becomes the alternate key and vice-versa. • In table1 and table2 there will be no alternate key because only one candidate key is there. Note: Alternate key satisfy “unique” constraint but not “NULL” constraint. Composite Key: If a key contains more than one attribute then it is called as composite key. For example: • Key (A,B) contains two attributes A and B therefore it is called as Composite key.
  • 9. Foreign Key Concept of Keys in Data Base Management System (DBMS) Definition: A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in another table. The table with the foreign key is called the child table, and the table with the primary key is called the referenced or parent table. (Child table का वह attribute जो पैरेंर रेबल की Primary key को refer करता है foreign key कहलाता है|) For example: Let us examine the following student and Department table. Note: Foreign key does not satisfy both “unique” and “NULL” constraint.
  • 10. Summary Concept of Keys in Data Base Management System (DBMS) Set of Super Keys Super key follows only “Unique” constraints but not “Not Null” Set of Candidate Key Candidate key follows only “Unique” constraints but not “Not Null” Set of Alternate Key Alternate key follows only “Unique” constraints but not “Not Null” Primary Key It follows both “Unique” and “Not null” constraints If a Key has more than one attributes ten it is called composite key Foreign key is used for referential integrity.
  • 11. Thank you for your attention Concept of Keys in Data Base Management System (DBMS) Q & A... Thank you.