Name: Sana Salah_ud_din
M.Sc CS (final)
Roll#: 138005
Topic: Keys In Relational
Database
AT A Glance:
Ø
What is :
Ø
A Key ?
Ø
A Super Key ?
Ø
A Candidate Key ?
Ø
A Primary Key ?
Ø
An Alternate Key ?
Ø
relational Key:
 A KEY is an attribute or set
of attributes that uniquely
identifies a TUPLE in a relation.
 There are two main types of key:
 A Super Key
 and a Foreign key
Relational
Keys
Super
Key
Foreign
Key
Candidate
Key
Primary
Key
Alternate
key
Candidate
Key
Super Key:
 An attribute, or set of attributes, that uniquely
identifies a tuple within a relation.
 A Super key may contain additional attributes that are
not necessary for unique identification.
 A super key is the most
general type of key.
EXAMPLE:
 As shown in the figure the relat-
ion Branch has a super key
Candidate key:
 A key which is the candidate for being selected as a
primary key.
 A candidate key contains only the attributes which can
uniquely identify a tuple in a relation.
 As shown in the figure --- in the
relation Branch the attributes
branchNo & postcode can serve
as candidate keys because both
can uniquely identify a tuple in
Primary key:
 The candidate key that is selected to identify tuples
uniquely within the relation.
 Some most important points about primary key are:
 A relation can have only one primary key.
 Each value in primary key attribute must be unique.
 Primary key cannot contain null values.
 As shown in the figure----
the attribute branchNo can
serve as primary key because
Alternate key:
 The candidate keys that are not selected as primary
key are known as alternate keys.
 As shown in the figure
the relation Branch has
branchNo serving as pri-
mary key and postcode
serving as alternate key
because postcode can
Composite Key:
 A primary key that consists of two or more attributes is
known as COMPOSITE KEY.
 As shown in the figu-
re– the relation Branch
has two attributes
serving as primary key
so this is a composite
key,
Foreign key:
 An attribute, or set of attributes, within one relation
that matches the candidate key of some relation..
 As shown in the figur-
e in the relation Staff
The attribute branchNo
is the foreign key
because it is the prim-
ary key in the relation
Branch.
The end

More Related Content

PPT
Constraints In Sql
PPTX
Integrity Constraints
PPT
Dbms relational model
PPTX
Sql fundamentals
PPT
Bsc cs ii-dbms-u-iv-normalization
PPT
Database Management System Introduction
Constraints In Sql
Integrity Constraints
Dbms relational model
Sql fundamentals
Bsc cs ii-dbms-u-iv-normalization
Database Management System Introduction

What's hot (20)

PPTX
1.4 data independence
PPTX
Relational model
PPTX
All data models in dbms
PPTX
Overview of Storage and Indexing ...
PPTX
Advantages of DBMS
PDF
SQL BUILT-IN FUNCTION
PPTX
Types of Database Models
PDF
2 database system concepts and architecture
DOCX
The three level of data modeling
PPSX
Functional dependency
PPTX
Relational Data Model Introduction
PPT
Relational algebra.pptx
PPTX
Database constraints
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPTX
String function in my sql
PPT
Normalization
PDF
DBMS Part-4.pdf
PPTX
Fundamentals of database system - Relational data model and relational datab...
PPTX
Introduction to DBMS(For College Seminars)
PDF
Database Normalization
1.4 data independence
Relational model
All data models in dbms
Overview of Storage and Indexing ...
Advantages of DBMS
SQL BUILT-IN FUNCTION
Types of Database Models
2 database system concepts and architecture
The three level of data modeling
Functional dependency
Relational Data Model Introduction
Relational algebra.pptx
Database constraints
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
String function in my sql
Normalization
DBMS Part-4.pdf
Fundamentals of database system - Relational data model and relational datab...
Introduction to DBMS(For College Seminars)
Database Normalization
Ad

Viewers also liked (13)

ODP
ER Model in DBMS
PPT
6. Integrity and Security in DBMS
PPT
Sql Authorization
PPT
11. Storage and File Structure in DBMS
PPTX
View of data DBMS
PPTX
Slide 5 keys
PPTX
DBMS Keys
PPT
2. Entity Relationship Model in DBMS
PPT
12. Indexing and Hashing in DBMS
PPT
15. Transactions in DBMS
PPT
DBMS - Normalization
ER Model in DBMS
6. Integrity and Security in DBMS
Sql Authorization
11. Storage and File Structure in DBMS
View of data DBMS
Slide 5 keys
DBMS Keys
2. Entity Relationship Model in DBMS
12. Indexing and Hashing in DBMS
15. Transactions in DBMS
DBMS - Normalization
Ad

Similar to Relational keys (20)

PPTX
DBMS key topic Presentation slide 1.pptx
PPTX
A Presentation of Types of Keys in RDBMS.pptx
PPTX
Dbms keys
PPTX
relational data model in RDBMS USING KEYS.pptx
PPTX
relational data model In rdbms keys.pptx
PPTX
relational data model in DBMS AND KEYS.pptx
PPTX
Database_Keys types of keys in DBMS.pptx
PPTX
Types Of Keys in DBMS
PDF
computer-210809080138.pdf
PDF
DBMS_Concept of Keys_Primary_Candidate.pdf
PDF
DBMS VHGFGJKFHVGFJKHHFVHGFHBBVVHGVVHGVBVHG
PPTX
The Relational Database Model
PPTX
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
PPTX
xi ip rdbms.pptxsieiw9wiejrnejow929wiejemm
PPTX
Relational Data Model| Database system.pptx
PPTX
Relational database Management system.pptx
PPTX
DBMS Keys.pptx
PDF
Advance database system (part 3)
PPTX
What are Database keys in Database System
PPTX
What are Database Keys in Database System
DBMS key topic Presentation slide 1.pptx
A Presentation of Types of Keys in RDBMS.pptx
Dbms keys
relational data model in RDBMS USING KEYS.pptx
relational data model In rdbms keys.pptx
relational data model in DBMS AND KEYS.pptx
Database_Keys types of keys in DBMS.pptx
Types Of Keys in DBMS
computer-210809080138.pdf
DBMS_Concept of Keys_Primary_Candidate.pdf
DBMS VHGFGJKFHVGFJKHHFVHGFHBBVVHGVVHGVBVHG
The Relational Database Model
Keys_in_DBMS_VALID_INFORMATION_IS_AVAILA
xi ip rdbms.pptxsieiw9wiejrnejow929wiejemm
Relational Data Model| Database system.pptx
Relational database Management system.pptx
DBMS Keys.pptx
Advance database system (part 3)
What are Database keys in Database System
What are Database Keys in Database System

Recently uploaded (20)

PDF
Architecture types and enterprise applications.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPT
What is a Computer? Input Devices /output devices
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Five Habits of High-Impact Board Members
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Modernising the Digital Integration Hub
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Architecture types and enterprise applications.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Getting started with AI Agents and Multi-Agent Systems
Assigned Numbers - 2025 - Bluetooth® Document
CloudStack 4.21: First Look Webinar slides
Enhancing emotion recognition model for a student engagement use case through...
What is a Computer? Input Devices /output devices
Module 1.ppt Iot fundamentals and Architecture
WOOl fibre morphology and structure.pdf for textiles
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
O2C Customer Invoices to Receipt V15A.pptx
A novel scalable deep ensemble learning framework for big data classification...
Five Habits of High-Impact Board Members
Developing a website for English-speaking practice to English as a foreign la...
Chapter 5: Probability Theory and Statistics
Zenith AI: Advanced Artificial Intelligence
Modernising the Digital Integration Hub
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf

Relational keys

  • 1. Name: Sana Salah_ud_din M.Sc CS (final) Roll#: 138005 Topic: Keys In Relational Database
  • 2. AT A Glance: Ø What is : Ø A Key ? Ø A Super Key ? Ø A Candidate Key ? Ø A Primary Key ? Ø An Alternate Key ? Ø
  • 3. relational Key:  A KEY is an attribute or set of attributes that uniquely identifies a TUPLE in a relation.  There are two main types of key:  A Super Key  and a Foreign key Relational Keys Super Key Foreign Key Candidate Key Primary Key Alternate key Candidate Key
  • 4. Super Key:  An attribute, or set of attributes, that uniquely identifies a tuple within a relation.  A Super key may contain additional attributes that are not necessary for unique identification.  A super key is the most general type of key. EXAMPLE:  As shown in the figure the relat- ion Branch has a super key
  • 5. Candidate key:  A key which is the candidate for being selected as a primary key.  A candidate key contains only the attributes which can uniquely identify a tuple in a relation.  As shown in the figure --- in the relation Branch the attributes branchNo & postcode can serve as candidate keys because both can uniquely identify a tuple in
  • 6. Primary key:  The candidate key that is selected to identify tuples uniquely within the relation.  Some most important points about primary key are:  A relation can have only one primary key.  Each value in primary key attribute must be unique.  Primary key cannot contain null values.  As shown in the figure---- the attribute branchNo can serve as primary key because
  • 7. Alternate key:  The candidate keys that are not selected as primary key are known as alternate keys.  As shown in the figure the relation Branch has branchNo serving as pri- mary key and postcode serving as alternate key because postcode can
  • 8. Composite Key:  A primary key that consists of two or more attributes is known as COMPOSITE KEY.  As shown in the figu- re– the relation Branch has two attributes serving as primary key so this is a composite key,
  • 9. Foreign key:  An attribute, or set of attributes, within one relation that matches the candidate key of some relation..  As shown in the figur- e in the relation Staff The attribute branchNo is the foreign key because it is the prim- ary key in the relation Branch.

Editor's Notes

  • #2: <number>