SlideShare a Scribd company logo
Module I – Session
3
Keys and It’s
Importance
Presented by
Dr.S.Zulaikha Beevi,
Professor/CSE.
RDBMS
Keys and its Importance in DBMS and RDBMS
Keys and its
importance
Keys play an important role in the relational database.
It is used to uniquely identify any record or row of data
from the table. It is also used to establish and
identify relationships between tables.
For example: In Student table, ID is used as a key because
it is unique for each student. In PERSON table,
passport_number, license_number, SSN are keys since
they are unique for each person.
Keys and its Importance in DBMS and RDBMS
Types of Key
Super Key
Super Key is the superset of primary key. The super key
contains a set of attributes, including the primary key,
which can uniquely identify any data row in the table.
For example: In the above EMPLOYEE table,
for(EMPLOEE_ID, EMPLOYEE_NAME) the name of two
employees can be the same, but their EMPLYEE_ID
can't be the same. Hence, this combination can also
be a key.
The super key would be EMPLOYEE-ID, (EMPLOYEE_ID,
EMPLOYEE-NAME), etc.
Candidate
key
Candidate Key - The candidate keys in a table are defined
as the set of keys that is minimal and can uniquely
identify any data row in the table.
For example: In the EMPLOYEE table, id is best suited
for the primary key. Rest of the attributes like SSN,
Passport_Number, and License_Number, etc. are
considered as a candidate key.
Primary
Key
The primary key is selected from one of the candidate
keys and becomes the identifying key of a table. It can
uniquely identify any data row of the table.
In the EMPLOYEE table, ID can be primary key since it is
unique for each employee. In the EMPLOYEE table, we
can even select License_Number and Passport_Number
as primary key since they are also unique.
Foreign
key
A foreign key is an attribute value in a table that acts as
the primary key in another table. Hence, the foreign
key is useful in linking together two tables.
In a company, every employee works in a specific
department, and employee and department are two
different entities. So we can't store the information of
the department in the employee table. That's why we
link these two tables through the primary key of one
table.
We add the primary key of the DEPARTMENT table,
Department_Id as a new attribute in the EMPLOYEE
table.
Now in the EMPLOYEE table, Department_Id is the
foreign key, and both the tables are related.
Keys and its Importance in DBMS and RDBMS
Composite Key - If any single attribute of a table is not
capable of being the key i.e it cannot identify a row
uniquely, then we combine two or more attributes to
form a key. This is known as a composite key.
Secondary Key - Only one of the candidate keys is
selected as the primary key. The rest of them are
known as secondary keys.
Keys and its Importance in DBMS and RDBMS
Qui
z
1. . A in a table represents a relationship among a set
of values.
a) Column
b) Key
c) Row
d) Entry
Answer: C
2. The term attribute refers to a of a
table.
a) Record
b) Column
c) Tuple
d) Key
Answer:
B

More Related Content

Similar to Keys and its Importance in DBMS and RDBMS (20)

PDF
DBMS_Keys.pdf
DianneParaase
 
PPTX
Dbms keysppt
ArunakumariAkula1
 
PPTX
Presentation OF DBMS-2.pptx
ShumailaSajjad
 
PPTX
B & c
Vaibhav Kathuria
 
PPTX
Keys.pptx
revathi s
 
PDF
Keys in DBMS
Pyingkodi Maran
 
PDF
Dbms keys
pyingkodi maran
 
PDF
2.2 keys
ELIMENG
 
PDF
Keys in Database
A. S. M. Shafi
 
PPTX
DBMS Keys.pptx
AryanGour1
 
PPTX
V35 keys-c
Dhirendra Chauhan
 
PPTX
Unit 3 introduction to Oracle and Sql.pptx
svasuki0708
 
PPTX
SQL_DBMS_KEYS.pptx
rahulsharma571283
 
PPTX
Database keys
Rahul Mishra
 
DOCX
Keys used in database
university of Gujrat, pakistan
 
PPT
ISDD Database Keys N5
Forrester High School
 
PPTX
key.pptx
laptophp39
 
PPTX
The Relational Database Model
Shishir Aryal
 
PPTX
Keys in DBMS.pptx
Revathy V R
 
PPTX
Key and its different types
Umair Shakir
 
DBMS_Keys.pdf
DianneParaase
 
Dbms keysppt
ArunakumariAkula1
 
Presentation OF DBMS-2.pptx
ShumailaSajjad
 
Keys.pptx
revathi s
 
Keys in DBMS
Pyingkodi Maran
 
Dbms keys
pyingkodi maran
 
2.2 keys
ELIMENG
 
Keys in Database
A. S. M. Shafi
 
DBMS Keys.pptx
AryanGour1
 
V35 keys-c
Dhirendra Chauhan
 
Unit 3 introduction to Oracle and Sql.pptx
svasuki0708
 
SQL_DBMS_KEYS.pptx
rahulsharma571283
 
Database keys
Rahul Mishra
 
Keys used in database
university of Gujrat, pakistan
 
ISDD Database Keys N5
Forrester High School
 
key.pptx
laptophp39
 
The Relational Database Model
Shishir Aryal
 
Keys in DBMS.pptx
Revathy V R
 
Key and its different types
Umair Shakir
 

Recently uploaded (20)

PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PPTX
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
PDF
Design Thinking basics for Engineers.pdf
CMR University
 
PPTX
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Amity University, Patna
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
PPTX
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
PPTX
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PPT
Electrical Safety Presentation for Basics Learning
AliJaved79382
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
Design Thinking basics for Engineers.pdf
CMR University
 
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Amity University, Patna
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Shinkawa Proposal to meet Vibration API670.pptx
AchmadBashori2
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
Element 11. ELECTRICITY safety and hazards
merrandomohandas
 
美国电子版毕业证南卡罗莱纳大学上州分校水印成绩单USC学费发票定做学位证书编号怎么查
Taqyea
 
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Thermal runway and thermal stability.pptx
godow93766
 
Electrical Safety Presentation for Basics Learning
AliJaved79382
 
Ad

Keys and its Importance in DBMS and RDBMS

  • 1. Module I – Session 3 Keys and It’s Importance Presented by Dr.S.Zulaikha Beevi, Professor/CSE.
  • 4. Keys and its importance Keys play an important role in the relational database. It is used to uniquely identify any record or row of data from the table. It is also used to establish and identify relationships between tables. For example: In Student table, ID is used as a key because it is unique for each student. In PERSON table, passport_number, license_number, SSN are keys since they are unique for each person.
  • 7. Super Key Super Key is the superset of primary key. The super key contains a set of attributes, including the primary key, which can uniquely identify any data row in the table. For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME) the name of two employees can be the same, but their EMPLYEE_ID can't be the same. Hence, this combination can also be a key. The super key would be EMPLOYEE-ID, (EMPLOYEE_ID, EMPLOYEE-NAME), etc.
  • 8. Candidate key Candidate Key - The candidate keys in a table are defined as the set of keys that is minimal and can uniquely identify any data row in the table. For example: In the EMPLOYEE table, id is best suited for the primary key. Rest of the attributes like SSN, Passport_Number, and License_Number, etc. are considered as a candidate key.
  • 9. Primary Key The primary key is selected from one of the candidate keys and becomes the identifying key of a table. It can uniquely identify any data row of the table. In the EMPLOYEE table, ID can be primary key since it is unique for each employee. In the EMPLOYEE table, we can even select License_Number and Passport_Number as primary key since they are also unique.
  • 10. Foreign key A foreign key is an attribute value in a table that acts as the primary key in another table. Hence, the foreign key is useful in linking together two tables. In a company, every employee works in a specific department, and employee and department are two different entities. So we can't store the information of the department in the employee table. That's why we link these two tables through the primary key of one table. We add the primary key of the DEPARTMENT table, Department_Id as a new attribute in the EMPLOYEE table. Now in the EMPLOYEE table, Department_Id is the foreign key, and both the tables are related.
  • 12. Composite Key - If any single attribute of a table is not capable of being the key i.e it cannot identify a row uniquely, then we combine two or more attributes to form a key. This is known as a composite key. Secondary Key - Only one of the candidate keys is selected as the primary key. The rest of them are known as secondary keys.
  • 14. Qui z 1. . A in a table represents a relationship among a set of values. a) Column b) Key c) Row d) Entry Answer: C
  • 15. 2. The term attribute refers to a of a table. a) Record b) Column c) Tuple d) Key Answer: B