SlideShare a Scribd company logo
Types of Keys
 Primary Key – This is an attribute or set of attributes that
uniquely indentify a specific instance of a record or an entity.
Every entity in the database must have a primary key whose value
uniquely identifies instances or records of the entity.
Features of the primary key are:
- It must have a non – null value for each instance
- The value must be unique
- The value must not change or become null during the life of each
entity instance
 Candidate Key – In some instances, an entity will have more
than one attribute that can serve as a primary key. Any key or
minimum set of keys that could be a primary key is called a
candidate key. Choose the identifier most commonly used by
the user as long as it conforms to the properties of the Primary
Key.
 Alternate Key (Secondary Key) – The Candidate Keys which
are not chosen as the Primary Key are known as alternate
keys.
 Composite Key – Sometimes it requires more than one
attribute to uniquely identify an entity. A primary that is made
up of more than one attribute is known as a composite key.
 Foreign Key – A foreign key is an attribute within a child
entity 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 instances of an entity. Every relationship
in the model must be supported by a foreign key.
TRN STUDENT
ID
LAST NAME FIRST
NAME
COURSE ID
100-000-001 SH-1001 ALLEN ROSENNA CHM-101
100-000-002 SH-1002 ALLWOOD PAULA-ANN BIO-101
100-000-003 SH-1003 BRADY BRIANA CHM-101
100-000-004 SH-1004 BURKE TIANA ICT-101

More Related Content

PPTX
Keys in Database Management System
ODP
Relational keys
PPT
Database Keys
PDF
XML Quick Reference (from mulberrytech.com)
KEY
Serving Code Samples
PPT
Jdt Features
PDF
JetBrains MPS: Structure Aspect
PPTX
Step 4: Start With The Basics
Keys in Database Management System
Relational keys
Database Keys
XML Quick Reference (from mulberrytech.com)
Serving Code Samples
Jdt Features
JetBrains MPS: Structure Aspect
Step 4: Start With The Basics

What's hot (7)

PPTX
Java tokens
PDF
PPTX
ER model to Relational model mapping
PPTX
Identifier in c
DOCX
Doc 20191022-wa0041
PDF
Natural Language Programming
PDF
Javanotes
Java tokens
ER model to Relational model mapping
Identifier in c
Doc 20191022-wa0041
Natural Language Programming
Javanotes
Ad

Similar to Types of Database Keys (8)

PPTX
DBMS Keys
PPTX
SQL_DBMS_KEYS.pptx
PPTX
Database_Keys types of keys in DBMS.pptx
PPT
Part 3 primary and foreign keys
PPTX
Keys presentation
PPTX
AASHUrdbms.pptx
PPT
DBMS Unit 2 ppt.ppt
PPTX
DBMS: Types of keys
DBMS Keys
SQL_DBMS_KEYS.pptx
Database_Keys types of keys in DBMS.pptx
Part 3 primary and foreign keys
Keys presentation
AASHUrdbms.pptx
DBMS Unit 2 ppt.ppt
DBMS: Types of keys
Ad

More from andyr91 (12)

PPTX
Attributes of 'well - engineered' software product
PPTX
The Functions of the Operating System
PPTX
Functions of the Operating System
PPTX
The Functions of the Operating System
PPTX
The Operating System
PPTX
The Design Phase
PPTX
Software Process Models
PPTX
Software Process Model (System Development Life Cycle)
PPTX
Intellectual property
PPTX
Why use a database?
PPTX
Information Management
PPTX
Advantages of using a database
Attributes of 'well - engineered' software product
The Functions of the Operating System
Functions of the Operating System
The Functions of the Operating System
The Operating System
The Design Phase
Software Process Models
Software Process Model (System Development Life Cycle)
Intellectual property
Why use a database?
Information Management
Advantages of using a database

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Institutional Correction lecture only . . .
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
master seminar digital applications in india
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Institutional Correction lecture only . . .
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
O5-L3 Freight Transport Ops (International) V1.pdf
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
master seminar digital applications in india
Abdominal Access Techniques with Prof. Dr. R K Mishra
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Microbial disease of the cardiovascular and lymphatic systems
Supply Chain Operations Speaking Notes -ICLT Program
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
2.FourierTransform-ShortQuestionswithAnswers.pdf
Anesthesia in Laparoscopic Surgery in India

Types of Database Keys

  • 2.  Primary Key – This is an attribute or set of attributes that uniquely indentify a specific instance of a record or an entity. Every entity in the database must have a primary key whose value uniquely identifies instances or records of the entity. Features of the primary key are: - It must have a non – null value for each instance - The value must be unique - The value must not change or become null during the life of each entity instance
  • 3.  Candidate Key – In some instances, an entity will have more than one attribute that can serve as a primary key. Any key or minimum set of keys that could be a primary key is called a candidate key. Choose the identifier most commonly used by the user as long as it conforms to the properties of the Primary Key.  Alternate Key (Secondary Key) – The Candidate Keys which are not chosen as the Primary Key are known as alternate keys.  Composite Key – Sometimes it requires more than one attribute to uniquely identify an entity. A primary that is made up of more than one attribute is known as a composite key.
  • 4.  Foreign Key – A foreign key is an attribute within a child entity 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 instances of an entity. Every relationship in the model must be supported by a foreign key.
  • 5. TRN STUDENT ID LAST NAME FIRST NAME COURSE ID 100-000-001 SH-1001 ALLEN ROSENNA CHM-101 100-000-002 SH-1002 ALLWOOD PAULA-ANN BIO-101 100-000-003 SH-1003 BRADY BRIANA CHM-101 100-000-004 SH-1004 BURKE TIANA ICT-101