SlideShare a Scribd company logo
DBMS KEYS
A Short Seminar On
Submitted To-
Deepak Paranjape Sir
Here I come to my topic i.e. Keys in DBMS.
• DBMS has Five types of Keys in it and they all has different functionality.
• The Keys are as follows:
• Super Key
• Candidate Key
• Primary Key
• Foreign Key
• Composite Key
Let’s discuss one by one all of the five keys.
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.
SUPER KEY
The combination of “SSN” and “Name” is a super key of the following entity set
customer.
Because:
The value of attributes “SSN” and “Name”, such as 558-36-1234 and
Susan, can uniquely identify that particular customer in customer entity set,
which is the pool of all customers.
Customer-name
Customer-street
customer
SSN
Customer-city
We are unsurprisingly very interested in the most
economical combination(s) of attributes that can
uniquely identify any particular entity.
Therefore, we introduce Candidate Key next.
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.
CANDIDATE KEY
While most entity sets have only one candidate key, some entity sets could
have more than one candidate key.
Candidate key could have more than one attributes.
In building a database in a database software, the software will only allow to
use one candidate key to be the unique identifier of an entity for an entity set.
Properties of Candidate Key…..
CANDIDATE KEY
• Example:
• (SSN, Name) is NOT a candidate key, because taking out “name” still leaves “SSN”
which can uniquely identify an entity. “SSN” is a candidate key of customer.
• Example: Both “SSN” and “License #” are candidate keys of Driver entity set.
Customer-name
Customer-street
customer
SSN
Customer-city
Overall, Super Key is the broadest unique identifier; Candidate Key is a
subset of Super Key; and Primary Key is a subset of Candidate Key.
In practice, we would first look for Super Keys. Then we look for Candidate
Keys based on experience and common sense.
If there is only one Candidate Key, it naturally will be designated as the
Primary Key.
If we find more than one Candidate Key, then we can designate any one of
them as Primary Key.
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.
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
PRIMARY KEY
Properties Of Primary Keys....
Primary and Foreign keys are the most basic
components on which relational theory is based.
Each entity must have a attribute or attributes, the
primary key, whose values uniquely identify each
instance of the entity. Every child entity must have
an attribute, the foreign key, that completes the
association with the parent entity.
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.
FOREIGN KEY
Every dependent and category (subtype) entity in the model must have a
foreign key for each relationship in which it participates.
Foreign keys are formed in dependent and subtype entities by migrating the
entire primary key from the parent or generic entity. If the primary key is
composite, it may not be split.
Properties Of Foreign Key….
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.
DBMS Keys

More Related Content

What's hot

Er model ppt
Er model pptEr model ppt
Er model ppt
Pihu Goel
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
Sharad Dubey
 
Data Models
Data ModelsData Models
Data Models
RituBhargava7
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
Shishir Aryal
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
Smriti Jain
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
GirdharRatne
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
sunanditaAnand
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
sadique_ghitm
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
RahulAnanda1
 
SQL commands
SQL commandsSQL commands
SQL commands
GirdharRatne
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
 
joins in database
 joins in database joins in database
joins in database
Sultan Arshad
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
Vineeta Garg
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
Chirag vasava
 
Triggers
TriggersTriggers
Triggers
Pooja Dixit
 

What's hot (20)

Er model ppt
Er model pptEr model ppt
Er model ppt
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Data Models
Data ModelsData Models
Data Models
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Relational model
Relational modelRelational model
Relational model
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
joins in database
 joins in database joins in database
joins in database
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Triggers
TriggersTriggers
Triggers
 

Viewers also liked

Slide 5 keys
Slide 5 keysSlide 5 keys
Slide 5 keys
Visakh V
 
Relational keys
Relational keysRelational keys
Relational keys
Sana2020
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 
Sql Authorization
Sql AuthorizationSql Authorization
Sql AuthorizationFhuy
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
Rahul Narang
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMSkoolkampus
 
RAID
RAIDRAID
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
Jitendra Tomar
 
Database Keys
Database KeysDatabase Keys
Database Keys
Forrester High School
 

Viewers also liked (12)

Slide 5 keys
Slide 5 keysSlide 5 keys
Slide 5 keys
 
Relational keys
Relational keysRelational keys
Relational keys
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Set operators
Set  operatorsSet  operators
Set operators
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 
Sql Authorization
Sql AuthorizationSql Authorization
Sql Authorization
 
View of data DBMS
View of data DBMSView of data DBMS
View of data DBMS
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
 
RAID
RAIDRAID
RAID
 
DBMS - Normalization
DBMS - NormalizationDBMS - Normalization
DBMS - Normalization
 
Database Keys
Database KeysDatabase Keys
Database Keys
 

Similar to DBMS Keys

SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
rahulsharma571283
 
Part 3 primary and foreign keys
Part 3 primary and foreign keysPart 3 primary and foreign keys
Part 3 primary and foreign keys
hussan fatima
 
Keys in Database Management System
Keys in Database Management SystemKeys in Database Management System
Keys in Database Management System
Ankit Rai
 
BIS03 Data Modelling - I
BIS03 Data Modelling - IBIS03 Data Modelling - I
BIS03 Data Modelling - I
Prithwis Mukerjee
 
Types of Database Keys
Types of Database KeysTypes of Database Keys
Types of Database Keys
andyr91
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
Abdullah Khosa
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
PraveenS761061
 
DBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptxDBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptx
sonudhakad173
 
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasanDatabase manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasan
Sheikh Monirul Hasan
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
sajinis5
 
ER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdf
SadiaSharmin40
 
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
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
A. S. M. Shafi
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
HamzaNadeem527928
 
database1
database1database1
database1
Monika Sharma
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
university of Gujrat, pakistan
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mcaEdhole.com
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
Dolchandra
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
Dolchandra
 
Key and its different types
Key and its different typesKey and its different types
Key and its different types
Umair Shakir
 

Similar to DBMS Keys (20)

SQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptxSQL_DBMS_KEYS.pptx
SQL_DBMS_KEYS.pptx
 
Part 3 primary and foreign keys
Part 3 primary and foreign keysPart 3 primary and foreign keys
Part 3 primary and foreign keys
 
Keys in Database Management System
Keys in Database Management SystemKeys in Database Management System
Keys in Database Management System
 
BIS03 Data Modelling - I
BIS03 Data Modelling - IBIS03 Data Modelling - I
BIS03 Data Modelling - I
 
Types of Database Keys
Types of Database KeysTypes of Database Keys
Types of Database Keys
 
Advance database system (part 3)
Advance database system (part 3)Advance database system (part 3)
Advance database system (part 3)
 
DBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.pptDBMS Unit 2 ppt.ppt
DBMS Unit 2 ppt.ppt
 
DBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptxDBMS key topic Presentation slide 1.pptx
DBMS key topic Presentation slide 1.pptx
 
Database manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasanDatabase manamement system_keys_sheikh_monirul_hasan
Database manamement system_keys_sheikh_monirul_hasan
 
DBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptxDBMS-Keys , Attributes and Constraints.pptx
DBMS-Keys , Attributes and Constraints.pptx
 
ER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdfER diagram slides for datanase stujdy-1.pdf
ER diagram slides for datanase stujdy-1.pdf
 
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
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Understanding Entity Relationship Models
Understanding Entity Relationship ModelsUnderstanding Entity Relationship Models
Understanding Entity Relationship Models
 
database1
database1database1
database1
 
Doc 20191022-wa0041
Doc 20191022-wa0041Doc 20191022-wa0041
Doc 20191022-wa0041
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
Key and its different types
Key and its different typesKey and its different types
Key and its different types
 

DBMS Keys

  • 1. DBMS KEYS A Short Seminar On Submitted To- Deepak Paranjape Sir
  • 2. Here I come to my topic i.e. Keys in DBMS. • DBMS has Five types of Keys in it and they all has different functionality. • The Keys are as follows: • Super Key • Candidate Key • Primary Key • Foreign Key • Composite Key Let’s discuss one by one all of the five keys.
  • 3. 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.
  • 4. SUPER KEY The combination of “SSN” and “Name” is a super key of the following entity set customer. Because: The value of attributes “SSN” and “Name”, such as 558-36-1234 and Susan, can uniquely identify that particular customer in customer entity set, which is the pool of all customers. Customer-name Customer-street customer SSN Customer-city
  • 5. We are unsurprisingly very interested in the most economical combination(s) of attributes that can uniquely identify any particular entity. Therefore, we introduce Candidate Key next.
  • 6. 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.
  • 7. CANDIDATE KEY While most entity sets have only one candidate key, some entity sets could have more than one candidate key. Candidate key could have more than one attributes. In building a database in a database software, the software will only allow to use one candidate key to be the unique identifier of an entity for an entity set. Properties of Candidate Key…..
  • 8. CANDIDATE KEY • Example: • (SSN, Name) is NOT a candidate key, because taking out “name” still leaves “SSN” which can uniquely identify an entity. “SSN” is a candidate key of customer. • Example: Both “SSN” and “License #” are candidate keys of Driver entity set. Customer-name Customer-street customer SSN Customer-city
  • 9. Overall, Super Key is the broadest unique identifier; Candidate Key is a subset of Super Key; and Primary Key is a subset of Candidate Key. In practice, we would first look for Super Keys. Then we look for Candidate Keys based on experience and common sense. If there is only one Candidate Key, it naturally will be designated as the Primary Key. If we find more than one Candidate Key, then we can designate any one of them as Primary Key.
  • 10. 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.
  • 11. 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 PRIMARY KEY Properties Of Primary Keys....
  • 12. Primary and Foreign keys are the most basic components on which relational theory is based. Each entity must have a attribute or attributes, the primary key, whose values uniquely identify each instance of the entity. Every child entity must have an attribute, the foreign key, that completes the association with the parent entity.
  • 13. 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.
  • 14. FOREIGN KEY Every dependent and category (subtype) entity in the model must have a foreign key for each relationship in which it participates. Foreign keys are formed in dependent and subtype entities by migrating the entire primary key from the parent or generic entity. If the primary key is composite, it may not be split. Properties Of Foreign Key….
  • 15. 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.