SlideShare a Scribd company logo
1 of 2
coursehunt.net - Search and discover online courses
Keys in Database
A relational Database is a set of named relations. Relations are sometimes are known
as table and generally representing an entity type. Each relation has a set of rows and
columns. Each row in a relation is termed as a tuple and each column represents an
attribute. Actually, each tuple represent an entity with its attributes.
In a relation, It is considered that no two tuples can represent same entity i.e two tuples
can’t have same values for all the attributes. Key attribute is the attribute that uniquely
identifies an entity or you can say, key attribute is that attribute for which two tuples
can’t have same values. This key attribute uniquely identifies an entity and all entities
will have different values for this attributes. Entities can have same or different values
for attributes other than key.
Consider the below given Relation ​STUDENT​.
STUDENT
Name Roll-no Registration
Number
Contact
Number
address
Aman 1005 a-1008 9245657682 Mumbai
Adhrav 1006 a-1009 7663455624 Aurangabad
Aman 1007 a-1010 8436858788 Mumbai
Ansh 1008 a-1011 7476727424 Ahemdabad
In the above given relation ​STUDENT​, there is a record for 4 students. For each
student, roll-no and registration numbers are different. No two students i.e tuples can
have same roll-no or registration numbers. These types of attributes for which no two
tuples can have same values are known as ​key attributes​.
coursehunt.net - Search and discover online courses
On the other hand, we can’t consider name as key attribute because two students can
have same name as Aman in above given relation. Also, Address can’t be considered
as key attribute for same reason. Now we come to contact number. Looking at this
relation, it seems we can consider contact number also as key attribute but remember
to not .Because key attribute are generally considered which are universally unique for
a Relation as roll-no and registration number for students of same university can’t be
same. But contact number can be same in some conditions. For example, suppose
there are two brothers sharing same mobile phone because of some economic or other
reason, then for them we will have same contact number. Therefore, it is recommended
not to include contact number as key attribute.

More Related Content

More from CourseHunt (6)

Big data
Big dataBig data
Big data
 
Ml basics
Ml basicsMl basics
Ml basics
 
Better programmer overview
Better programmer   overviewBetter programmer   overview
Better programmer overview
 
Joins in databases
Joins in databases Joins in databases
Joins in databases
 
Binary Tree - Algorithms
Binary Tree - Algorithms Binary Tree - Algorithms
Binary Tree - Algorithms
 
Introduction to Android Programming
Introduction to Android ProgrammingIntroduction to Android Programming
Introduction to Android Programming
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 

Keys in database

  • 1. coursehunt.net - Search and discover online courses Keys in Database A relational Database is a set of named relations. Relations are sometimes are known as table and generally representing an entity type. Each relation has a set of rows and columns. Each row in a relation is termed as a tuple and each column represents an attribute. Actually, each tuple represent an entity with its attributes. In a relation, It is considered that no two tuples can represent same entity i.e two tuples can’t have same values for all the attributes. Key attribute is the attribute that uniquely identifies an entity or you can say, key attribute is that attribute for which two tuples can’t have same values. This key attribute uniquely identifies an entity and all entities will have different values for this attributes. Entities can have same or different values for attributes other than key. Consider the below given Relation ​STUDENT​. STUDENT Name Roll-no Registration Number Contact Number address Aman 1005 a-1008 9245657682 Mumbai Adhrav 1006 a-1009 7663455624 Aurangabad Aman 1007 a-1010 8436858788 Mumbai Ansh 1008 a-1011 7476727424 Ahemdabad In the above given relation ​STUDENT​, there is a record for 4 students. For each student, roll-no and registration numbers are different. No two students i.e tuples can have same roll-no or registration numbers. These types of attributes for which no two tuples can have same values are known as ​key attributes​.
  • 2. coursehunt.net - Search and discover online courses On the other hand, we can’t consider name as key attribute because two students can have same name as Aman in above given relation. Also, Address can’t be considered as key attribute for same reason. Now we come to contact number. Looking at this relation, it seems we can consider contact number also as key attribute but remember to not .Because key attribute are generally considered which are universally unique for a Relation as roll-no and registration number for students of same university can’t be same. But contact number can be same in some conditions. For example, suppose there are two brothers sharing same mobile phone because of some economic or other reason, then for them we will have same contact number. Therefore, it is recommended not to include contact number as key attribute.