Database management system keys presentation slide created by Sheikh Monirul Hasan. The database management system is a technique to manage data through some language like SQL. So there I have discussed the keys concept of a database. The slide provides the all possible knowledge about database management system keys I think the presentation slide will be helpful for university student, especially for CSE departments student.
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