SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Welcome to my Presentation
Submitted by :
Sheikh Monirul Hasan
Id: 162015077
Department: CSE
Green University of Bangladesh
Submitted to :
Biplob Chandra Debnath
Lecturer : CSE
1
• DBMS has Five types of Keys in it and they all has different functionality.
• The Keys are as follows:
• Primary Key
• Unique Key
• Super Key
• Candidate Key
• Foreign Key
Let’s discuss one by one all of the five keys with example.
Presentation topic – DBMS Keys
2
PRIMARY KEY
The Primary Key is an attribute or a set of attributes that uniquely identify a specific
instance of an entity.
Every entity in the data model must have a primary key whose values uniquely identify
instances of the entity.
3
PRIMARY KEY
Properties Of Primary Keys
To qualify as a primary key for an entity, an attribute must have the
following properties:
It must have a non-null value for each instance of the entity
The value must be unique for each instance of an entity
The values must not change or become null during the life of each entity instance
4
PRIMARY KEY
Example :
Roll_NO Name Address
1 Sheikh Monirul Hasan Mirpur, Dhaka , Bangladesh
2 Sakib Mohakhali
3 Safa shawrapara
5
Unique Key
Unique key
Unique key is one or more column in a table used to uniquely identify each row in the table . It can
contain NULL value.
Example:
student table :
Uu
Roll_No Name Address
1 Arafat Mirpur
- Mission Dhanmondi
3 Safa Shawrapara
6
SUPER KEY
Super Key is a set of attributes whose set of values can uniquely identify an entity
instance in the entity set.
A Super Key can contains one or more than one attributes.
Super Key is the broadest definition of unique identifiers of an entity in an entity
set.
7
Super Key
Example :
Roll_No Name Address
1 Arafat Mirpur
2 Mission Dhanmondi
3 Safa Shawrapara
{Roll_No}, {Roll_No,Name} , {Roll_No,Adderss}, {Roll_No, Name, Address} all these sets are super
key.
8
CANDIDATE KEY
Candidate key is a set of one or more attributes whose set of values can
uniquely identify an entity instance in the entity set.
Any attribute in the candidate key cannot be omitted without destroying the
uniqueness property of the Candidate key.
It is minimal Super Key.
9
CANDIDATE KEY
Example:
Roll_No Name Phone_No City
121 Anik 765368 Jamalpur
451 Jakir 982312 Magura
762 Ridoy 095421 Faridpur
876 Mokles 532134 Manikgonj
{Roll_No}, {Phone-No} are two candidate key. Because we can
consider any one of these as a primary key .
10
FOREIGN KEY
A Foreign key is an attribute that completes a relationship by identifying the parent
entity.
Foreign keys provide a method for maintaining integrity in the data (called referential
integrity) and for navigating between different instances of an entity.
Every relationship in the model must be supported by a foreign key.
11
Foreign Key
Example :
Roll_No Name Address
162015040 Arafat Mirpur
162015029 Mission Dhanmondi
162015015 Safa Shawrapara
Roll_No Semester Marks
162015040 III 80
162015029 V 70
162015015 VII 75
Here Roll_No of marks table is foreign key.
Student table :
Marks table :
12
COMPOSITE KEY
When a primary key is created from a combination of 2 or more columns, the
primary key is called a composite key.
Each column may not be unique by itself within the database table but when
combined with the other column(s) in the composite key, the combination is
unique.
13
COMPOSITE KEY
Example:
14
15
For the more information you can check out Sheikh Monirul Hasan
Connect with me in social media
Facebook
LinkedIn
Twitter
16

Weitere ähnliche Inhalte

Was ist angesagt?

Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 
5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java5- Overriding and Abstraction In Java
5- Overriding and Abstraction In JavaGhadeer AlHasan
 
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING ARADHYAYANA
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentationtigerwarn
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in DatabaseFatiha Qureshi
 
Special lecture er diagram
Special lecture er diagramSpecial lecture er diagram
Special lecture er diagramNiaz Ali
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational databaseJyoti Ranjan Pattnaik
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramSiti Ismail
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagramHaseeb
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2eidah20
 
Presentation database about ERD
Presentation database about ERDPresentation database about ERD
Presentation database about ERDElis Ervina
 

Was ist angesagt? (20)

Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java
 
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
ER DIAGRAM TO RELATIONAL SCHEMA MAPPING
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentation
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
Mapping
MappingMapping
Mapping
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in Database
 
E R Diagram
E R DiagramE R Diagram
E R Diagram
 
RDBMS
RDBMSRDBMS
RDBMS
 
Python revision tour -I
Python revision tour -IPython revision tour -I
Python revision tour -I
 
Special lecture er diagram
Special lecture er diagramSpecial lecture er diagram
Special lecture er diagram
 
Theory of dependencies in relational database
Theory of dependencies in relational databaseTheory of dependencies in relational database
Theory of dependencies in relational database
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagram
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2Chapter3 the relational data model and the relation database constraints part2
Chapter3 the relational data model and the relation database constraints part2
 
RDBMS ERD
RDBMS ERDRDBMS ERD
RDBMS ERD
 
Presentation database about ERD
Presentation database about ERDPresentation database about ERD
Presentation database about ERD
 
Entity relation(1)
Entity relation(1)Entity relation(1)
Entity relation(1)
 

Ähnlich wie Database manamement system_keys_sheikh_monirul_hasan

Ähnlich wie Database manamement system_keys_sheikh_monirul_hasan (20)

DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Database normalization
Database normalizationDatabase normalization
Database normalization
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
Database keys
Database keysDatabase keys
Database keys
 
SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
 
Keys in Database
Keys in DatabaseKeys in Database
Keys in Database
 
Keys in Database Management System
Keys in Database Management SystemKeys in Database Management System
Keys in Database Management System
 
Keys in DBMS.pptx
Keys in DBMS.pptxKeys in DBMS.pptx
Keys in DBMS.pptx
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
 
Relational Model
Relational ModelRelational Model
Relational Model
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Lecture 2 - Relational Model and Terminology.pptx
Lecture 2 - Relational Model and Terminology.pptxLecture 2 - Relational Model and Terminology.pptx
Lecture 2 - Relational Model and Terminology.pptx
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
V35 keys-c
V35  keys-cV35  keys-c
V35 keys-c
 
Dbms keysppt
Dbms keyspptDbms keysppt
Dbms keysppt
 
Database management systems 3 - Data Modelling
Database management systems 3 - Data ModellingDatabase management systems 3 - Data Modelling
Database management systems 3 - Data Modelling
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
 

Kürzlich hochgeladen

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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Kürzlich hochgeladen (20)

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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
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
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Database manamement system_keys_sheikh_monirul_hasan

  • 1. Welcome to my Presentation Submitted by : Sheikh Monirul Hasan Id: 162015077 Department: CSE Green University of Bangladesh Submitted to : Biplob Chandra Debnath Lecturer : CSE 1
  • 2. • DBMS has Five types of Keys in it and they all has different functionality. • The Keys are as follows: • Primary Key • Unique Key • Super Key • Candidate Key • Foreign Key Let’s discuss one by one all of the five keys with example. Presentation topic – DBMS Keys 2
  • 3. PRIMARY KEY The Primary Key is an attribute or a set of attributes that uniquely identify a specific instance of an entity. Every entity in the data model must have a primary key whose values uniquely identify instances of the entity. 3
  • 4. PRIMARY KEY Properties Of Primary Keys To qualify as a primary key for an entity, an attribute must have the following properties: It must have a non-null value for each instance of the entity The value must be unique for each instance of an entity The values must not change or become null during the life of each entity instance 4
  • 5. PRIMARY KEY Example : Roll_NO Name Address 1 Sheikh Monirul Hasan Mirpur, Dhaka , Bangladesh 2 Sakib Mohakhali 3 Safa shawrapara 5
  • 6. Unique Key Unique key Unique key is one or more column in a table used to uniquely identify each row in the table . It can contain NULL value. Example: student table : Uu Roll_No Name Address 1 Arafat Mirpur - Mission Dhanmondi 3 Safa Shawrapara 6
  • 7. SUPER KEY Super Key is a set of attributes whose set of values can uniquely identify an entity instance in the entity set. A Super Key can contains one or more than one attributes. Super Key is the broadest definition of unique identifiers of an entity in an entity set. 7
  • 8. Super Key Example : Roll_No Name Address 1 Arafat Mirpur 2 Mission Dhanmondi 3 Safa Shawrapara {Roll_No}, {Roll_No,Name} , {Roll_No,Adderss}, {Roll_No, Name, Address} all these sets are super key. 8
  • 9. CANDIDATE KEY Candidate key is a set of one or more attributes whose set of values can uniquely identify an entity instance in the entity set. Any attribute in the candidate key cannot be omitted without destroying the uniqueness property of the Candidate key. It is minimal Super Key. 9
  • 10. CANDIDATE KEY Example: Roll_No Name Phone_No City 121 Anik 765368 Jamalpur 451 Jakir 982312 Magura 762 Ridoy 095421 Faridpur 876 Mokles 532134 Manikgonj {Roll_No}, {Phone-No} are two candidate key. Because we can consider any one of these as a primary key . 10
  • 11. FOREIGN KEY A Foreign key is an attribute that completes a relationship by identifying the parent entity. Foreign keys provide a method for maintaining integrity in the data (called referential integrity) and for navigating between different instances of an entity. Every relationship in the model must be supported by a foreign key. 11
  • 12. Foreign Key Example : Roll_No Name Address 162015040 Arafat Mirpur 162015029 Mission Dhanmondi 162015015 Safa Shawrapara Roll_No Semester Marks 162015040 III 80 162015029 V 70 162015015 VII 75 Here Roll_No of marks table is foreign key. Student table : Marks table : 12
  • 13. COMPOSITE KEY When a primary key is created from a combination of 2 or more columns, the primary key is called a composite key. Each column may not be unique by itself within the database table but when combined with the other column(s) in the composite key, the combination is unique. 13
  • 15. 15 For the more information you can check out Sheikh Monirul Hasan Connect with me in social media Facebook LinkedIn Twitter
  • 16. 16