SlideShare una empresa de Scribd logo
1 de 21
Types of Keys in
Database Management System
Dr. Kamal Gulati
Why we have Keys in DB?
• A Key is an attribute or a set of attributes in a
relation that identifies a tuple (record) in a
relation.
• The keys are defined in a table to access or
sequence the stored data quickly and
smoothly.
• They are also used to create relationship
between different tables.
Dr. Kamal Gulati
Types of Keys in Database
• 1. Primary Key
• 2. Candidate Key
• 3. Alternate Key
• 4. Super Key
• 5. Composite Key
• 6. Foreign Key
• 7. Unique Key
Dr. Kamal Gulati
Primary Key
Employee
EmployeeID
EmployeeName
SSN
DeptID
DOB
• Which is Unique & Can’t be have
NULL Value
• Is the column you choose to
maintain uniqueness in a table at
row level.
• Here in Employee table we can
choose either EmployeeID or SSN
column for a PK.
• EmployeeID is preferable choice
because SSN is a secure (PII) value.
Dr. Kamal Gulati
Primary Key
• It is a candidate key that is chosen by the
database designer to identify entities with in
an entity set.
• Primary key is the minimal super keys. In the
ER diagram primary key is represented by
underlining the primary key attribute.
• Ideally a primary key is composed of only a
single attribute.
• But it is possible to have a primary key
composed of more than one attribute.
Dr. Kamal Gulati
To define a field as primary key,
following conditions had to be met :
• 1. No two rows can have the same primary key
value.
• 2. Every row must have a primary key value.
• 3. The primary key field cannot be null.
• 4. Value in a primary key column can never be
modified or updated, if any foreign key refers
to that primary key.
Dr. Kamal Gulati
Candidate Key
Employee
EmployeeID
EmployeeName
SSN
DeptID
DOB
• Are individual columns in a table
that qualifies for uniqueness of
each row/tuple.
• Here in Employee table
EmployeeID & SSN are eligible
for a Primary Key and thus are
Candidate keys.
• Candidate Keys are super keys
for which no proper subset is a
super key. In other words
candidate keys are minimal
super keys.
Dr. Kamal Gulati
Alternate Key
Employee
EmployeeID
EmployeeName
SSN
DeptID
DOB
• Candidate column other the
Primary column, like
if EmployeeID is set for a PK
then SSN would be the Alternate
key.
Dr. Kamal Gulati
Super Key
Employee
EmployeeID
EmployeeName
SSN
DeptID
DOB
• If you add any other Column /
Attribute to a Primary Key then it
become a Super Key,
like EmployeeID +
EmployeeName is a Super Key.
• Super key stands for superset of
a key.
• A Super Key is a set of one or
more attributes that are taken
collectively and can identify all
other attributes uniquely.
Dr. Kamal Gulati
Composite Key
Employee
EmployeeID
EmployeeName
SSN
DeptID
DOB
• If a table do have a single column
that qualifies for a Candidate key,
then you have to select 2 or more
columns to make a row unique.
• Like if there is no EmployeeID or
SSN columns, then you can
make EmployeeName +
DateOfBirth (DOB) as Composite
Primary Key. But still there can be
a narrow chance of duplicate rows.
Dr. Kamal Gulati
Foreign KeyEmployee
EmployeeID
EmployeeName
SSN
DeptID
DOB
Department
DeptID
DeptName
• Here in above tables DeptID of Department
table is Primary Key where as DeptID of
Employee is an Foreign key.
• It means it has referred to another table. This
concept is also know as Referential Integrity.
Dr. Kamal Gulati
Unique Key
• Unique key is same as
primary with the difference
being the existence of null.
• Unique key field allows one
value as NULL value.
Employee
EmployeeID
EmployeeName
SSN
EmailID
DOB
Dr. Kamal Gulati
Practical Example
• Table R1. Let A,B,C,D,E are the attributes
of this relation.
• A→BCDE (This means the attribute 'A'
uniquely determines the other attributes
B,C,D,E.)
BC→ADE (This means the attributes 'BC'
jointly determines all the other attributes
A,D,E in the relation.)
• Find the following:
– Primary Key
– Candidate Key
– Super Key
– Composite Key
Table – R1
A
B
C
D
E
Dr. Kamal Gulati
Answers:
•Primary Key: A
•Candidate Key: A & BC
•Super Key: A, BC, AE, AD & ABC
•Composite Key: BC
Dr. Kamal Gulati
(Hope you are able to
understand Different Types of
Keys in Database)
For More Questions /
Queries Feel Free to
Contact me.
Dr. Kamal Gulati
Dr. Kamal Gulati
Associate Professor |
University Quality Support Head
Mentoring Programme Coordinator &
Exam Superintendent |
[Ph. D., M.Sc. (Computer Science), M.C.A., M.B.A]
Professional Certifications:
• Certified Microsoft Innovative Educator
• Data Science 101 Certification from Big Data University
• R Language 101 Certification from Big Data University
• SQL Certification from SOLOLEARN.com
• Certified IBM Big Data 101 from Big Data University
• R Program & Python Certified from DataCamp
• Wiley Certified Big Data Analyst [WCBDA]
• Certification on DBMS from IIT Mumbai
• Certified Cisco Certified Network Associate [CCNA]
• Certified Microsoft Certified Professional [MCP]
• Certified Brainbench in (MS Access, MS Project, MySQL 5.7 Administration, Computer
Fundamentals, Advanced Ms. Excel & Windows OS)
• Real-time Advertising Fundamentals Certified from RTA Academy
• Worked as Visiting Professor with Stratford University, USA for six months from Jan’2016 to
June’2016.
• Also worked at Bahrain University in Kingdom of Bahrain Sr. I.T. Faculty (Computer Science
Department) for Period of 2 Years.
• Have rich experience in the field of teaching and research in Computer Science and Information
Technology for almost 15+ years in Academia.
• Having experience of working with both private and public institutions and universities as the
lecturer and self-instruction material writer for Information Technology courses.
• Had number of research papers published in national and international journals and conference
proceedings in IEEE and Scopus Index.
• Also chaired various National and International Conferences of repute and associated with
various International Journals as Editorial Board Member for International and National,
Academic Adviser and Research Paper Reviewer.
• My current area of interest: Big Data Analytics, R Software, Internet & Web Technology, IT Project
Management, Decision Support System, Business Analytics, Management Information System,
Database Management System, Data Networking, R Software and Advanced Excel with Visual
Basic Macros.
• Country Visited: USA, Canada, UAE, Bahrain, Oman (Mostly for Teaching and Research Purpose)
Profile of Dr. Kamal Gulati
Profile Contd….
• Technical Program Committee for International Conference on Data, Engineering and Applications 2017
(IDEA-2k17) which would be on October 28-29, 2017 at Bhopal. http://www.ideaconference.in
• Advisory Board Committee Member for International Conference on Energy, Communication, Data
Analytics and Soft Computing (ICECDS) which would be on 1-2 August 2017 at SKR Engineering College,
Poonamallee, Tamil Nadu, India. http://ecds.org.in
• Advisory Committee Member for International Conference on Innovative Research in Engineering and
Science which would be on 16-17 June 2017 at Asian Institute of Technology Conference Center
Thailand. http://www.iresconf.org
• Advisory Committee Member for International Conference on Cloud Computing and Internet of
everything which held on 10-11 Feb’2016 at Delhi-NCR. http://www.ccioet.org
• Technical Committee member for InCITe-2016 (International Conference on Information Technology)
Theme - Internet of Things: Connect Your Worlds, IT Summit, Amity University 2016 which held on 06-07
Oct, 2016. http://www.amity.edu/incite2016
• Technical Speaker for Global perspective on IT business “The Changing Scenario” – Big Data on
International Students Conference New Delhi (ISCND) which held on 14-15 Oct, 2016 http://iscnd.com
• Advisory Committee Member for International Conference on Sustainable Computing Techniques in
Engineering, Science and Management which has held on 09-10 Sep’2016 at Delhi-NCR.
http://www.scesm.org
• Technical Program Committee Member for Program Committee Member for International Conference on
Recent Trends IN ICT, Jaipur, India, Aug 18-19, 2017 http://rtict.org
• Program Committee Member for International Conference on Recent Advancement in Computer and
Communication Bhopal, India, (IC-RAC-2017) May 26-27, 2017 http://www.icrac.co.in
Profile Contd….
• Editorial Board member for the following International Journals:
– International Journal of Computer Science and Innovation
http://www.infinitysciences.org
– International Journal of Latest Research in Engineering and Technology
http://www.ijlret.com
– International Journal of Latest Trends in Engineering and Technology
http://www.ijltet.org
– International Journal of Application or
Innovation in Engineering & Management
http://www.ijaiem.org
– International Journal for Management http://www.ijm-apm.com
– The International Journal of Emerging Engineering and Embedded Systems
http://www.ijeees.org
– Conference Info http://conferenceinfo.org/tpc.php
• Expert Speaker for Program “Insurance Beyond Doubt” Presented by Oriental
Insurance Co Ltd.
https://www.youtube.com/watch?v=GrvJkN_Zn3Q
BOOK, CHAPTER, and CASE STUDY Published
• Published Book on “A Study of Changing Trends in E-CRM of Indian
Insurance Industry” Published by LAP Lambert Academic Publishing, one
of the top researchers and renowned scientists of Germany with ISBN:
3330009543, 9783330009547. The Book available at Amazon.com.
• Published Real Case Study on “IoT Security Considerations for Higher
Education” published on Business Cases - RENVOI 2017 BOOK (The Case
Centre, UK) with ISBN: 978-1-4828-8840-9, Page 63-70. The Book available
at the various online website: Amazon, AbeBooks, Chegg, Barnes & Noble.
• Published Chapter on "Role of eWorld in Insurance Innovation" Published
by Insurance Institute of India (III), 60 Years Diamond Jubilee,
Compendium, Nov 2016 – (Magazine) – One of the premium Insurance
Institute of India.
Contact Details
• Email : drkamalgulati@gmail.com
• Website : http://mybigdataanalytics.com
• LinkedIn : https://in.linkedin.com/in/drkamalgulati
• Twitter : @DrKamalGulati
• Skype : kamalgulati7
• Phone: +91-9718361928

Más contenido relacionado

La actualidad más candente

All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
Naresh Kumar
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
Mohd Arif
 

La actualidad más candente (20)

Database Keys
Database KeysDatabase Keys
Database Keys
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 
ER MODEL
ER MODELER MODEL
ER MODEL
 
Structure of dbms
Structure of dbmsStructure of dbms
Structure of dbms
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Relational model
Relational modelRelational model
Relational model
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Fundamentals of DBMS
Fundamentals of DBMSFundamentals of DBMS
Fundamentals of DBMS
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Data models
Data modelsData models
Data models
 
Database
DatabaseDatabase
Database
 
Introduction to Databases by Dr. Kamal Gulati
Introduction to Databases by Dr. Kamal GulatiIntroduction to Databases by Dr. Kamal Gulati
Introduction to Databases by Dr. Kamal Gulati
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
Types of keys in database | SQL
Types of keys in database | SQLTypes of keys in database | SQL
Types of keys in database | SQL
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
 

Similar a Types of keys in database management system by Dr. Kamal Gulati

Premanand_Jha
Premanand_JhaPremanand_Jha
Premanand_Jha
Prem Jha
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
NurulIzrin
 
Intelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversionIntelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversion
IAEME Publication
 
New_Resume_Pramod_01222016
New_Resume_Pramod_01222016New_Resume_Pramod_01222016
New_Resume_Pramod_01222016
Pramod Bm
 
Amit_K_Dhal_Data_Analyst-1
Amit_K_Dhal_Data_Analyst-1Amit_K_Dhal_Data_Analyst-1
Amit_K_Dhal_Data_Analyst-1
Pin2 Dhal
 

Similar a Types of keys in database management system by Dr. Kamal Gulati (20)

Alok.Resume_3.4
Alok.Resume_3.4Alok.Resume_3.4
Alok.Resume_3.4
 
AnalytixLabs - Data Science 360 (Nasscom)-1648178720283 (1).pdf
AnalytixLabs - Data Science 360 (Nasscom)-1648178720283 (1).pdfAnalytixLabs - Data Science 360 (Nasscom)-1648178720283 (1).pdf
AnalytixLabs - Data Science 360 (Nasscom)-1648178720283 (1).pdf
 
Intro of Key Features of SoftCAAT BI SQL Software
Intro of Key Features of SoftCAAT BI SQL SoftwareIntro of Key Features of SoftCAAT BI SQL Software
Intro of Key Features of SoftCAAT BI SQL Software
 
Premanand_Jha
Premanand_JhaPremanand_Jha
Premanand_Jha
 
Arpit Srivastava
Arpit SrivastavaArpit Srivastava
Arpit Srivastava
 
Future career goals in it
Future career goals in itFuture career goals in it
Future career goals in it
 
Enhancing Enterprise Search with Machine Learning - Simon Hughes, Dice.com
Enhancing Enterprise Search with Machine Learning - Simon Hughes, Dice.comEnhancing Enterprise Search with Machine Learning - Simon Hughes, Dice.com
Enhancing Enterprise Search with Machine Learning - Simon Hughes, Dice.com
 
Week 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptxWeek 2 - Database System Development Lifecycle-old.pptx
Week 2 - Database System Development Lifecycle-old.pptx
 
Conceptual vs. Logical vs. Physical Data Modeling
Conceptual vs. Logical vs. Physical Data ModelingConceptual vs. Logical vs. Physical Data Modeling
Conceptual vs. Logical vs. Physical Data Modeling
 
A Beard, An App, A Blender
A Beard, An App, A BlenderA Beard, An App, A Blender
A Beard, An App, A Blender
 
Intelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversionIntelligent query converter a domain independent interfacefor conversion
Intelligent query converter a domain independent interfacefor conversion
 
Password management
Password managementPassword management
Password management
 
New_Resume_Pramod_01222016
New_Resume_Pramod_01222016New_Resume_Pramod_01222016
New_Resume_Pramod_01222016
 
Amit_K_Dhal_Data_Analyst-1
Amit_K_Dhal_Data_Analyst-1Amit_K_Dhal_Data_Analyst-1
Amit_K_Dhal_Data_Analyst-1
 
Taming the shrew Power BI
Taming the shrew Power BITaming the shrew Power BI
Taming the shrew Power BI
 
Intro of Key Features of eCAAT Ent Software
 Intro of Key Features of eCAAT Ent Software Intro of Key Features of eCAAT Ent Software
Intro of Key Features of eCAAT Ent Software
 
Business analyst with project training
Business analyst with project trainingBusiness analyst with project training
Business analyst with project training
 
Intro of key features of eCAAT Pro Software
Intro of key features of eCAAT Pro SoftwareIntro of key features of eCAAT Pro Software
Intro of key features of eCAAT Pro Software
 
Utiva Presesentation-Shamsudeen Suleiman.pptx
Utiva Presesentation-Shamsudeen Suleiman.pptxUtiva Presesentation-Shamsudeen Suleiman.pptx
Utiva Presesentation-Shamsudeen Suleiman.pptx
 
Text Mining & Sentiment Analysis made easy, with Azure and Power BI
Text Mining & Sentiment Analysis made easy, with Azure and Power BIText Mining & Sentiment Analysis made easy, with Azure and Power BI
Text Mining & Sentiment Analysis made easy, with Azure and Power BI
 

Más de Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU

All About DBMS - Interview Question and Answers
All About DBMS - Interview Question and AnswersAll About DBMS - Interview Question and Answers

Más de Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU (20)

All About DBMS - Interview Question and Answers
All About DBMS - Interview Question and AnswersAll About DBMS - Interview Question and Answers
All About DBMS - Interview Question and Answers
 
Concept of Governance - Management of Operational Risk for IT Officers/Execut...
Concept of Governance - Management of Operational Risk for IT Officers/Execut...Concept of Governance - Management of Operational Risk for IT Officers/Execut...
Concept of Governance - Management of Operational Risk for IT Officers/Execut...
 
Emerging Technologies in IT
Emerging Technologies in ITEmerging Technologies in IT
Emerging Technologies in IT
 
Introduction to DBMS - Notes in Layman...
Introduction to DBMS - Notes in Layman...Introduction to DBMS - Notes in Layman...
Introduction to DBMS - Notes in Layman...
 
CASE (Computer Aided Software Design)
CASE (Computer Aided Software Design)CASE (Computer Aided Software Design)
CASE (Computer Aided Software Design)
 
SOFTWARE RELIABILITY AND QUALITY ASSURANCE
SOFTWARE RELIABILITY AND QUALITY ASSURANCESOFTWARE RELIABILITY AND QUALITY ASSURANCE
SOFTWARE RELIABILITY AND QUALITY ASSURANCE
 
Software Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC ModelSoftware Testing (Contd..) SDLC Model
Software Testing (Contd..) SDLC Model
 
Software Testing - SDLC Model
Software Testing - SDLC ModelSoftware Testing - SDLC Model
Software Testing - SDLC Model
 
Coding - SDLC Model
Coding - SDLC ModelCoding - SDLC Model
Coding - SDLC Model
 
Software Design - SDLC Model
Software Design - SDLC ModelSoftware Design - SDLC Model
Software Design - SDLC Model
 
Models of SDLC (Contd..) & Feasibility Study
Models of SDLC (Contd..)  & Feasibility StudyModels of SDLC (Contd..)  & Feasibility Study
Models of SDLC (Contd..) & Feasibility Study
 
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
CLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKET
CLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKETCLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKET
CLOUD SECURITY IN INSURANCE INDUSTRY WITH RESPECT TO INDIAN MARKET
 
Application Software
Application SoftwareApplication Software
Application Software
 
Application Software – Horizontal & Vertical Software
Application Software – Horizontal & Vertical SoftwareApplication Software – Horizontal & Vertical Software
Application Software – Horizontal & Vertical Software
 
Software: Systems and Application Software
Software:  Systems and Application SoftwareSoftware:  Systems and Application Software
Software: Systems and Application Software
 
Programming Languages
Programming LanguagesProgramming Languages
Programming Languages
 
Number Codes and Registers
Number Codes and RegistersNumber Codes and Registers
Number Codes and Registers
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
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
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
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.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
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
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Types of keys in database management system by Dr. Kamal Gulati

  • 1. Types of Keys in Database Management System Dr. Kamal Gulati
  • 2. Why we have Keys in DB? • A Key is an attribute or a set of attributes in a relation that identifies a tuple (record) in a relation. • The keys are defined in a table to access or sequence the stored data quickly and smoothly. • They are also used to create relationship between different tables. Dr. Kamal Gulati
  • 3. Types of Keys in Database • 1. Primary Key • 2. Candidate Key • 3. Alternate Key • 4. Super Key • 5. Composite Key • 6. Foreign Key • 7. Unique Key Dr. Kamal Gulati
  • 4. Primary Key Employee EmployeeID EmployeeName SSN DeptID DOB • Which is Unique & Can’t be have NULL Value • Is the column you choose to maintain uniqueness in a table at row level. • Here in Employee table we can choose either EmployeeID or SSN column for a PK. • EmployeeID is preferable choice because SSN is a secure (PII) value. Dr. Kamal Gulati
  • 5. Primary Key • It is a candidate key that is chosen by the database designer to identify entities with in an entity set. • Primary key is the minimal super keys. In the ER diagram primary key is represented by underlining the primary key attribute. • Ideally a primary key is composed of only a single attribute. • But it is possible to have a primary key composed of more than one attribute. Dr. Kamal Gulati
  • 6. To define a field as primary key, following conditions had to be met : • 1. No two rows can have the same primary key value. • 2. Every row must have a primary key value. • 3. The primary key field cannot be null. • 4. Value in a primary key column can never be modified or updated, if any foreign key refers to that primary key. Dr. Kamal Gulati
  • 7. Candidate Key Employee EmployeeID EmployeeName SSN DeptID DOB • Are individual columns in a table that qualifies for uniqueness of each row/tuple. • Here in Employee table EmployeeID & SSN are eligible for a Primary Key and thus are Candidate keys. • Candidate Keys are super keys for which no proper subset is a super key. In other words candidate keys are minimal super keys. Dr. Kamal Gulati
  • 8. Alternate Key Employee EmployeeID EmployeeName SSN DeptID DOB • Candidate column other the Primary column, like if EmployeeID is set for a PK then SSN would be the Alternate key. Dr. Kamal Gulati
  • 9. Super Key Employee EmployeeID EmployeeName SSN DeptID DOB • If you add any other Column / Attribute to a Primary Key then it become a Super Key, like EmployeeID + EmployeeName is a Super Key. • Super key stands for superset of a key. • A Super Key is a set of one or more attributes that are taken collectively and can identify all other attributes uniquely. Dr. Kamal Gulati
  • 10. Composite Key Employee EmployeeID EmployeeName SSN DeptID DOB • If a table do have a single column that qualifies for a Candidate key, then you have to select 2 or more columns to make a row unique. • Like if there is no EmployeeID or SSN columns, then you can make EmployeeName + DateOfBirth (DOB) as Composite Primary Key. But still there can be a narrow chance of duplicate rows. Dr. Kamal Gulati
  • 11. Foreign KeyEmployee EmployeeID EmployeeName SSN DeptID DOB Department DeptID DeptName • Here in above tables DeptID of Department table is Primary Key where as DeptID of Employee is an Foreign key. • It means it has referred to another table. This concept is also know as Referential Integrity. Dr. Kamal Gulati
  • 12. Unique Key • Unique key is same as primary with the difference being the existence of null. • Unique key field allows one value as NULL value. Employee EmployeeID EmployeeName SSN EmailID DOB Dr. Kamal Gulati
  • 13. Practical Example • Table R1. Let A,B,C,D,E are the attributes of this relation. • A→BCDE (This means the attribute 'A' uniquely determines the other attributes B,C,D,E.) BC→ADE (This means the attributes 'BC' jointly determines all the other attributes A,D,E in the relation.) • Find the following: – Primary Key – Candidate Key – Super Key – Composite Key Table – R1 A B C D E Dr. Kamal Gulati
  • 14. Answers: •Primary Key: A •Candidate Key: A & BC •Super Key: A, BC, AE, AD & ABC •Composite Key: BC Dr. Kamal Gulati
  • 15. (Hope you are able to understand Different Types of Keys in Database) For More Questions / Queries Feel Free to Contact me. Dr. Kamal Gulati
  • 16. Dr. Kamal Gulati Associate Professor | University Quality Support Head Mentoring Programme Coordinator & Exam Superintendent | [Ph. D., M.Sc. (Computer Science), M.C.A., M.B.A] Professional Certifications: • Certified Microsoft Innovative Educator • Data Science 101 Certification from Big Data University • R Language 101 Certification from Big Data University • SQL Certification from SOLOLEARN.com • Certified IBM Big Data 101 from Big Data University • R Program & Python Certified from DataCamp • Wiley Certified Big Data Analyst [WCBDA] • Certification on DBMS from IIT Mumbai • Certified Cisco Certified Network Associate [CCNA] • Certified Microsoft Certified Professional [MCP] • Certified Brainbench in (MS Access, MS Project, MySQL 5.7 Administration, Computer Fundamentals, Advanced Ms. Excel & Windows OS) • Real-time Advertising Fundamentals Certified from RTA Academy
  • 17. • Worked as Visiting Professor with Stratford University, USA for six months from Jan’2016 to June’2016. • Also worked at Bahrain University in Kingdom of Bahrain Sr. I.T. Faculty (Computer Science Department) for Period of 2 Years. • Have rich experience in the field of teaching and research in Computer Science and Information Technology for almost 15+ years in Academia. • Having experience of working with both private and public institutions and universities as the lecturer and self-instruction material writer for Information Technology courses. • Had number of research papers published in national and international journals and conference proceedings in IEEE and Scopus Index. • Also chaired various National and International Conferences of repute and associated with various International Journals as Editorial Board Member for International and National, Academic Adviser and Research Paper Reviewer. • My current area of interest: Big Data Analytics, R Software, Internet & Web Technology, IT Project Management, Decision Support System, Business Analytics, Management Information System, Database Management System, Data Networking, R Software and Advanced Excel with Visual Basic Macros. • Country Visited: USA, Canada, UAE, Bahrain, Oman (Mostly for Teaching and Research Purpose) Profile of Dr. Kamal Gulati
  • 18. Profile Contd…. • Technical Program Committee for International Conference on Data, Engineering and Applications 2017 (IDEA-2k17) which would be on October 28-29, 2017 at Bhopal. http://www.ideaconference.in • Advisory Board Committee Member for International Conference on Energy, Communication, Data Analytics and Soft Computing (ICECDS) which would be on 1-2 August 2017 at SKR Engineering College, Poonamallee, Tamil Nadu, India. http://ecds.org.in • Advisory Committee Member for International Conference on Innovative Research in Engineering and Science which would be on 16-17 June 2017 at Asian Institute of Technology Conference Center Thailand. http://www.iresconf.org • Advisory Committee Member for International Conference on Cloud Computing and Internet of everything which held on 10-11 Feb’2016 at Delhi-NCR. http://www.ccioet.org • Technical Committee member for InCITe-2016 (International Conference on Information Technology) Theme - Internet of Things: Connect Your Worlds, IT Summit, Amity University 2016 which held on 06-07 Oct, 2016. http://www.amity.edu/incite2016 • Technical Speaker for Global perspective on IT business “The Changing Scenario” – Big Data on International Students Conference New Delhi (ISCND) which held on 14-15 Oct, 2016 http://iscnd.com • Advisory Committee Member for International Conference on Sustainable Computing Techniques in Engineering, Science and Management which has held on 09-10 Sep’2016 at Delhi-NCR. http://www.scesm.org • Technical Program Committee Member for Program Committee Member for International Conference on Recent Trends IN ICT, Jaipur, India, Aug 18-19, 2017 http://rtict.org • Program Committee Member for International Conference on Recent Advancement in Computer and Communication Bhopal, India, (IC-RAC-2017) May 26-27, 2017 http://www.icrac.co.in
  • 19. Profile Contd…. • Editorial Board member for the following International Journals: – International Journal of Computer Science and Innovation http://www.infinitysciences.org – International Journal of Latest Research in Engineering and Technology http://www.ijlret.com – International Journal of Latest Trends in Engineering and Technology http://www.ijltet.org – International Journal of Application or Innovation in Engineering & Management http://www.ijaiem.org – International Journal for Management http://www.ijm-apm.com – The International Journal of Emerging Engineering and Embedded Systems http://www.ijeees.org – Conference Info http://conferenceinfo.org/tpc.php • Expert Speaker for Program “Insurance Beyond Doubt” Presented by Oriental Insurance Co Ltd. https://www.youtube.com/watch?v=GrvJkN_Zn3Q
  • 20. BOOK, CHAPTER, and CASE STUDY Published • Published Book on “A Study of Changing Trends in E-CRM of Indian Insurance Industry” Published by LAP Lambert Academic Publishing, one of the top researchers and renowned scientists of Germany with ISBN: 3330009543, 9783330009547. The Book available at Amazon.com. • Published Real Case Study on “IoT Security Considerations for Higher Education” published on Business Cases - RENVOI 2017 BOOK (The Case Centre, UK) with ISBN: 978-1-4828-8840-9, Page 63-70. The Book available at the various online website: Amazon, AbeBooks, Chegg, Barnes & Noble. • Published Chapter on "Role of eWorld in Insurance Innovation" Published by Insurance Institute of India (III), 60 Years Diamond Jubilee, Compendium, Nov 2016 – (Magazine) – One of the premium Insurance Institute of India.
  • 21. Contact Details • Email : drkamalgulati@gmail.com • Website : http://mybigdataanalytics.com • LinkedIn : https://in.linkedin.com/in/drkamalgulati • Twitter : @DrKamalGulati • Skype : kamalgulati7 • Phone: +91-9718361928