SlideShare a Scribd company logo
Database Management
System
Bhoomika Patel , Assistant Professor
Computer Science & Engineering
Relational Databse Design
CHAPTER-5
Content
s
● Functional Dependency – definition, trivial and non-trivial FD
● Armstrong's Axioms/Inference Rules
● Closure of FD
● Closure of Attributes
● Candidate Key
● Finding a Candidate Key
● Decomposition (Lossy & Lossless)
● Database Anomalies
● normalization – 1Nf, 2NF, 3NF, BCNF, 4NF, 5NF
● Functional Dependency:
● Brief overview of databases and the importance of data integrity.
● Introduction to Functional Dependencies (FD) as a concept ensuring data consistency.
● Functional Dependency (FD) is a constraint between two sets of attributes in a relation from a
database.
● Notation: X→YX rightarrow YX→Y
● Meaning: Attribute Y is functionally dependent on attribute X if each value of X is associated with
precisely one value of Y.
● Example:
● Table with attributes: StudentID, StudentName, CourseID, CourseName
● Example FD: StudentID→StudentNameStudentID rightarrow
StudentNameStudentID→StudentName, CourseID→CourseNameCourseID rightarrow
CourseNameCourseID→CourseName
● Explanation of the relationship between the attributes.
● Trivial Functional Dependency:
● Definition: A functional dependency X→YX rightarrow YX→Y is trivial if YYY is a subset of XXX.
● Example: If X={A,B}X = {A, B}X={A,B}, then A→AA rightarrow AA→A and {A,B}→A{A, B}
rightarrow A{A,B}→A are trivial FDs.
● Explanation: These dependencies hold true by default.
● Non-Trivial Functional Dependency:
● Definition: A functional dependency X→YX rightarrow YX→Y is non-trivial if YYY is not a subset of
XXX.
● Example: If X={A}X = {A}X={A} and Y={B}Y = {B}Y={B}, then A→BA rightarrow BA→B is non-
trivial.
● Explanation: These dependencies provide meaningful constraints in database design.
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
● Candidatekey:
● A candidate key is a minimal set of attributes that can uniquely identify a tuple in a relation.
● Every relation can have one or more candidate keys.
● Finding candidate key:
Given a relation and a set of functional dependencies:
● Relation R(A, B, C, D)
● FDs: {A → B, C → D}
Step-by-step process to identify candidate keys.
● Decomposition:
● Decomposition is the process of breaking down a relation into two or more
sub-relations.
● Purpose: To eliminate redundancy, prevent anomalies, and ensure data
integrity.
● Types:
● Lossy Decomposition
● Lossless Decomposition
● Lossy Decomposition:
● Definition: Decomposition where the original relation cannot be perfectly
reconstructed from the decomposed sub-relations.
● Example: Illustrative example showing data loss after decomposition.
● Consequences: Data anomalies, potential loss of information.
● Given relation R(A, B, C).
● Decomposed into R1(A, B) and R2(B, C).
● Loss of information due to redundancy in B.
● Illustration of how original relation cannot be accurately reconstructed.
Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules
● Lossless Decomposition:
● Definition: Decomposition where the original relation can be perfectly
reconstructed from the decomposed sub-relations.
● Conditions: Dependency preservation and ensuring common attributes form a
super key.
● Importance: Ensures data integrity and prevents anomalies.
● Given relation R(A, B, C).
● Decomposed into R1(A, B) and R2(A, C).
● Reconstruction: Natural join of R1 and R2 restores the original relation.
● Illustration of how the original relation is accurately reconstructed.
● Database Anomalies:
● Definition: Inconsistencies or errors in a database due to improper database
design.
● Causes: Typically caused by redundancy and lack of normalization.
First Normal Form (1NF)
○ Definition: A relation is in 1NF if it contains only atomic (indivisible) values.
○ Rules: No repeating groups, no multi-valued attributes.
○ Example: Converting a table with repeating groups to 1NF.
Example: First Normal Form (1NF)
○ Initial table with repeating groups.
○ Conversion to 1NF by eliminating repeating groups and ensuring atomic values.
Second Normal Form (2NF)
○ Definition: A relation is in 2NF if it is in 1NF and all non-key attributes are fully dependent on
the primary key.
○ Rule: Eliminate partial dependencies.
○ Example: Converting a table from 1NF to 2NF.
example: Second Normal Form (2NF)
○ Initial table in 1NF with partial dependencies.
○ Conversion to 2NF by removing partial dependencies and creating separate tables.
Third Normal Form (3NF):
○ Definition: A relation is in 3NF if it is in 2NF and all the attributes are functionally
dependent only on the primary key.
○ Rule: Eliminate transitive dependencies.
○ Example: Converting a table from 2NF to 3NF.
Example: Third Normal Form (3NF)
○ Initial table in 2NF with transitive dependencies.
○ Conversion to 3NF by removing transitive dependencies and creating separate
tables.
Boyce-Codd Normal Form (BCNF)
○ Definition: A relation is in BCNF if it is in 3NF and every determinant is a candidate key.
○ Rule: Handle situations where 3NF is insufficient.
○ Example: Converting a table from 3NF to BCNF.
Example: Boyce-Codd Normal Form (BCNF)
○ Initial table in 3NF with anomalies.
○ Conversion to BCNF by ensuring every determinant is a candidate key.
Fourth Normal Form (4NF)
○ Definition: A relation is in 4NF if it is in BCNF and has no multi-valued dependencies.
○ Rule: Eliminate multi-valued dependencies.
○ Example: Converting a table from BCNF to 4NF.
Example: Fourth Normal Form (4NF)
○ Initial table in BCNF with multi-valued dependencies.
○ Conversion to 4NF by removing multi-valued dependencies and creating separate tables.
Fifth Normal Form (5NF)
○ Definition: A relation is in 5NF if it is in 4NF and has no join dependencies.
○ Rule: Eliminate join dependencies.
○ Example: Converting a table from 4NF to 5NF.
Example: Fifth Normal Form (5NF)
○ Initial table in 4NF with join dependencies.
○ Conversion to 5NF by removing join dependencies and ensuring that the table can be
decomposed into smaller tables without loss of information.
www.paruluniversity.ac.
in

More Related Content

Similar to Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules (20)

PPTX
Normalization in rdbms types and examples
BackiyalakshmiVenkat
 
PDF
Relational Database Design
Prabu U
 
PPTX
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
 
PDF
L8 design1
Tianlu Wang
 
PPT
UNIT-IV.ppt
Minu Choudhary
 
PPTX
Normalisation
Soumyajit Dutta
 
PPT
Database normalization
VARSHAKUMARI49
 
PPTX
normalization .pptx types and the examples
jayapriya060226
 
PDF
Introduction to database-Normalisation
Ajit Nayak
 
PPT
Mca ii-dbms-u-iv-structured query language
Rai University
 
PDF
Normalization in DBMS
Pyingkodi Maran
 
PDF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
 
PPTX
CC03_FDAnnnnnnnnnnnnnnnnnnnnnndNoon.pptx
HenryQuang1
 
PDF
functionaldependenciesandnormalization-150628061940-lva1-app6891.pdf
Anvesha Joshi
 
PPTX
Functional dependencies and normalization
daxesh chauhan
 
PPT
Normalization_dsa_project_easy_with_graph.ppt
guitarsoul9876
 
PPT
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
HemaSenthil5
 
PPTX
Normalization.pptx Functional dependence
sadiariasat10
 
PPTX
Fd & Normalization - Database Management System
Drishti Bhalla
 
Normalization in rdbms types and examples
BackiyalakshmiVenkat
 
Relational Database Design
Prabu U
 
L1-Normalization 1NF 2NF 3NF 4NF BCNF.pptx
ChandrashekharSingh859453
 
L8 design1
Tianlu Wang
 
UNIT-IV.ppt
Minu Choudhary
 
Normalisation
Soumyajit Dutta
 
Database normalization
VARSHAKUMARI49
 
normalization .pptx types and the examples
jayapriya060226
 
Introduction to database-Normalisation
Ajit Nayak
 
Mca ii-dbms-u-iv-structured query language
Rai University
 
Normalization in DBMS
Pyingkodi Maran
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
 
CC03_FDAnnnnnnnnnnnnnnnnnnnnnndNoon.pptx
HenryQuang1
 
functionaldependenciesandnormalization-150628061940-lva1-app6891.pdf
Anvesha Joshi
 
Functional dependencies and normalization
daxesh chauhan
 
Normalization_dsa_project_easy_with_graph.ppt
guitarsoul9876
 
MODULE 3 -Normalization bwdhwbifnweipfnewknfqekndd_1.ppt
HemaSenthil5
 
Normalization.pptx Functional dependence
sadiariasat10
 
Fd & Normalization - Database Management System
Drishti Bhalla
 

Recently uploaded (20)

PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PPT
Testing and final inspection of a solar PV system
MuhammadSanni2
 
PDF
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
Water Resources Engineering (CVE 728)--Slide 3.pptx
mohammedado3
 
PPTX
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PDF
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PDF
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
PDF
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PDF
Digital water marking system project report
Kamal Acharya
 
PDF
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
PDF
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Testing and final inspection of a solar PV system
MuhammadSanni2
 
Submit Your Papers-International Journal on Cybernetics & Informatics ( IJCI)
IJCI JOURNAL
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
澳洲电子毕业证澳大利亚圣母大学水印成绩单UNDA学生证网上可查学历
Taqyea
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
Water Resources Engineering (CVE 728)--Slide 3.pptx
mohammedado3
 
MODULE 04 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
mbse_An_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
MODULE-5 notes [BCG402-CG&V] PART-B.pdf
Alvas Institute of Engineering and technology, Moodabidri
 
Data structures notes for unit 2 in computer science.pdf
sshubhamsingh265
 
aAn_Introduction_to_Arcadia_20150115.pdf
henriqueltorres1
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
Digital water marking system project report
Kamal Acharya
 
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
AN EMPIRICAL STUDY ON THE USAGE OF SOCIAL MEDIA IN GERMAN B2C-ONLINE STORES
ijait
 
Ad

Relational Database Design Functional Dependency – definition, trivial and non-trivial FD, Armstrong's Axioms/Inference Rules

  • 1. Database Management System Bhoomika Patel , Assistant Professor Computer Science & Engineering
  • 3. Content s ● Functional Dependency – definition, trivial and non-trivial FD ● Armstrong's Axioms/Inference Rules ● Closure of FD ● Closure of Attributes ● Candidate Key ● Finding a Candidate Key ● Decomposition (Lossy & Lossless) ● Database Anomalies ● normalization – 1Nf, 2NF, 3NF, BCNF, 4NF, 5NF
  • 4. ● Functional Dependency: ● Brief overview of databases and the importance of data integrity. ● Introduction to Functional Dependencies (FD) as a concept ensuring data consistency. ● Functional Dependency (FD) is a constraint between two sets of attributes in a relation from a database. ● Notation: X→YX rightarrow YX→Y ● Meaning: Attribute Y is functionally dependent on attribute X if each value of X is associated with precisely one value of Y. ● Example: ● Table with attributes: StudentID, StudentName, CourseID, CourseName ● Example FD: StudentID→StudentNameStudentID rightarrow StudentNameStudentID→StudentName, CourseID→CourseNameCourseID rightarrow CourseNameCourseID→CourseName ● Explanation of the relationship between the attributes.
  • 5. ● Trivial Functional Dependency: ● Definition: A functional dependency X→YX rightarrow YX→Y is trivial if YYY is a subset of XXX. ● Example: If X={A,B}X = {A, B}X={A,B}, then A→AA rightarrow AA→A and {A,B}→A{A, B} rightarrow A{A,B}→A are trivial FDs. ● Explanation: These dependencies hold true by default.
  • 6. ● Non-Trivial Functional Dependency: ● Definition: A functional dependency X→YX rightarrow YX→Y is non-trivial if YYY is not a subset of XXX. ● Example: If X={A}X = {A}X={A} and Y={B}Y = {B}Y={B}, then A→BA rightarrow BA→B is non- trivial. ● Explanation: These dependencies provide meaningful constraints in database design.
  • 24. ● Candidatekey: ● A candidate key is a minimal set of attributes that can uniquely identify a tuple in a relation. ● Every relation can have one or more candidate keys. ● Finding candidate key: Given a relation and a set of functional dependencies: ● Relation R(A, B, C, D) ● FDs: {A → B, C → D} Step-by-step process to identify candidate keys.
  • 25. ● Decomposition: ● Decomposition is the process of breaking down a relation into two or more sub-relations. ● Purpose: To eliminate redundancy, prevent anomalies, and ensure data integrity. ● Types: ● Lossy Decomposition ● Lossless Decomposition
  • 26. ● Lossy Decomposition: ● Definition: Decomposition where the original relation cannot be perfectly reconstructed from the decomposed sub-relations. ● Example: Illustrative example showing data loss after decomposition. ● Consequences: Data anomalies, potential loss of information. ● Given relation R(A, B, C). ● Decomposed into R1(A, B) and R2(B, C). ● Loss of information due to redundancy in B. ● Illustration of how original relation cannot be accurately reconstructed.
  • 28. ● Lossless Decomposition: ● Definition: Decomposition where the original relation can be perfectly reconstructed from the decomposed sub-relations. ● Conditions: Dependency preservation and ensuring common attributes form a super key. ● Importance: Ensures data integrity and prevents anomalies. ● Given relation R(A, B, C). ● Decomposed into R1(A, B) and R2(A, C). ● Reconstruction: Natural join of R1 and R2 restores the original relation. ● Illustration of how the original relation is accurately reconstructed.
  • 29. ● Database Anomalies: ● Definition: Inconsistencies or errors in a database due to improper database design. ● Causes: Typically caused by redundancy and lack of normalization.
  • 30. First Normal Form (1NF) ○ Definition: A relation is in 1NF if it contains only atomic (indivisible) values. ○ Rules: No repeating groups, no multi-valued attributes. ○ Example: Converting a table with repeating groups to 1NF. Example: First Normal Form (1NF) ○ Initial table with repeating groups. ○ Conversion to 1NF by eliminating repeating groups and ensuring atomic values.
  • 31. Second Normal Form (2NF) ○ Definition: A relation is in 2NF if it is in 1NF and all non-key attributes are fully dependent on the primary key. ○ Rule: Eliminate partial dependencies. ○ Example: Converting a table from 1NF to 2NF. example: Second Normal Form (2NF) ○ Initial table in 1NF with partial dependencies. ○ Conversion to 2NF by removing partial dependencies and creating separate tables.
  • 32. Third Normal Form (3NF): ○ Definition: A relation is in 3NF if it is in 2NF and all the attributes are functionally dependent only on the primary key. ○ Rule: Eliminate transitive dependencies. ○ Example: Converting a table from 2NF to 3NF. Example: Third Normal Form (3NF) ○ Initial table in 2NF with transitive dependencies. ○ Conversion to 3NF by removing transitive dependencies and creating separate tables.
  • 33. Boyce-Codd Normal Form (BCNF) ○ Definition: A relation is in BCNF if it is in 3NF and every determinant is a candidate key. ○ Rule: Handle situations where 3NF is insufficient. ○ Example: Converting a table from 3NF to BCNF. Example: Boyce-Codd Normal Form (BCNF) ○ Initial table in 3NF with anomalies. ○ Conversion to BCNF by ensuring every determinant is a candidate key.
  • 34. Fourth Normal Form (4NF) ○ Definition: A relation is in 4NF if it is in BCNF and has no multi-valued dependencies. ○ Rule: Eliminate multi-valued dependencies. ○ Example: Converting a table from BCNF to 4NF. Example: Fourth Normal Form (4NF) ○ Initial table in BCNF with multi-valued dependencies. ○ Conversion to 4NF by removing multi-valued dependencies and creating separate tables.
  • 35. Fifth Normal Form (5NF) ○ Definition: A relation is in 5NF if it is in 4NF and has no join dependencies. ○ Rule: Eliminate join dependencies. ○ Example: Converting a table from 4NF to 5NF. Example: Fifth Normal Form (5NF) ○ Initial table in 4NF with join dependencies. ○ Conversion to 5NF by removing join dependencies and ensuring that the table can be decomposed into smaller tables without loss of information.