Functional Dependency
• The functional dependency is a relationship that exists between two
attributes. It typically exists between the primary key and non-key
attribute within a table.
X → Y
• The left side of FD is known as a determinant, the right side of the
production is known as a dependent.
For example:
• Assume we have an employee table with attributes: Emp_Id, Emp_Name,
Emp_Address.
• Here Emp_Id attribute can uniquely identify the Emp_Name attribute of
employee table because if we know the Emp_Id, we can tell that
employee name associated with it.
• Functional dependency can be written as:
• Emp_Id → Emp_Name
• We can say that Emp_Name is functionally dependent on Emp_Id.
DBMS 3.pdf
Types of Functional dependency
1. Trivial functional dependency
A → B has trivial functional dependency if B is a subset of A OR EQUAL TO A
i.e A ⊇ B
The following dependencies are also trivial like: A → A, B → B
Example:
Consider a table with two columns Employee_Id and Employee_Name.
{Employee_id, Employee_Name} → Employee_Id is a trivial functional dep
endency as
Employee_Id is a subset of {Employee_Id, Employee_Name}.
Also, Employee_Id → Employee_Id and Employee_Name → Employee_Na
me are trivial dependencies too.
2. Non-trivial functional dependency
• A → B has a non-trivial functional dependency if B is not a subset of A.
• When A intersection B is NULL i.e. A∩B=Ф then A → B is called as
complete non-trivial.
Example:
• ID → Name,
• Name → DOB
3.Semi Non trivial functional dependency
Employee_Id → Employee_Id Employee_Name
Employee_Id → Employee_Id Employee_Id → Employee_Name
DBMS 3.pdf
Inference Rule (IR):
• The Armstrong's axioms are the basic inference rule.
• Armstrong's axioms are used to conclude functional dependencies on a
relational database.
• The inference rule is a type of assertion. It can apply to a set of
FD(functional dependency) to derive other FD.
• Using the inference rule, we can derive additional functional dependency
from the initial set.
• The Functional dependency has 6 types of inference rule:
• 1. Reflexive Rule (IR1
)
• In the reflexive rule, if Y is a subset of X, then X determines Y.
• If X ⊇ Y then X → Y
• Example:
2. Augmentation Rule (IR2
)
• The augmentation is also called as a partial dependency. In augmentation,
if X determines Y, then XZ determines YZ for any Z.
• If X → Y then XZ → YZ
Example:
• For R(ABCD), if A → B then AC → BC
3. Transitive Rule (IR3
)
• In the transitive rule, if X determines Y and Y determine Z, then X must
also determine Z.
• If X → Y and Y → Z then X → Z
4. Union Rule (IR4
)
• Union rule says, if X determines Y and X determines Z, then X must also
determine Y and Z.
• If X → Y and X → Z then X → YZ
5. Decomposition Rule (IR5
)
• Decomposition rule is also known as project rule. It is the reverse of union
rule.
• This Rule says, if X determines Y and Z, then X determines Y and X
determines Z separately.
• If X → YZ then X → Y and X → Z
Proof:
1. X → YZ (given)
2. YZ → Y (using IR1
Rule)
3. X → Y (using IR3
on 1 and 2)
6. Pseudo transitive Rule (IR6
)
• In Pseudo transitive Rule, if X determines Y and YZ determines W, then XZ
determines W.
• If X → Y and YZ → W then XZ → W
Proof:
1. X → Y (given)
2. WY → Z (given)
3. WX → WY (using IR2
on 1 by augmenting with W)
4. WX → Z (using IR3
on 3 and 2)
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
Relational Decomposition
• When a relation in the relational model is not in appropriate
normal form then the decomposition of a relation is required.
• In a database, it breaks the table into multiple tables.
• If the relation has no proper decomposition, then it may lead to
problems like loss of information.
• Decomposition is used to eliminate some of the problems of bad
design like anomalies, inconsistencies, and redundancy.
Types of Decomposition
1.Lossless Decomposition
2.Dependency Preserving
DBMS 3.pdf
Dependency Preserving
• It is an important constraint of the database.
• In the dependency preservation, at least one decomposed
table must satisfy every dependency.
• If a relation R is decomposed into relation R1 and R2, then the
dependencies of R either must be a part of R1 or R2 or must
be derivable from the combination of functional
dependencies of R1 and R2.
• For example, suppose there is a relation R (A, B, C, D) with
functional dependency set (A->BC). The relational R is
decomposed into R1(ABC) and R2(AD) which is dependency
preserving because FD A->BC is a part of relation R1(ABC).
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
Lossless Decomposition
• If the information is not lost from the relation that is decomposed,
then the decomposition will be lossless.
• The lossless decomposition guarantees that the join of relations will
result in the same relation as it was decomposed.
• The relation is said to be lossless decomposition if natural joins of
all the decomposition give the original relation.
Example:
EMPLOYEE_DEPARTMENT table:
EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME
22 Denim 28 Mumbai 827 Sales
33 Alina 25 Delhi 438 Marketing
46 Stephan 30 Bangalore 869 Finance
52 Katherine 36 Mumbai 575 Production
60 Jack 40 Noida 678 Testing
The above relation is decomposed into two relations EMPLOYEE and DEPARTMENT
EMPLOYEE table:
EMP_ID EMP_NAME EMP_AGE EMP_CITY
22 Denim 28 Mumbai
33 Alina 25 Delhi
46 Stephan 30 Bangalore
52 Katherine 36 Mumbai
60 Jack 40 Noida
DEPARTMENT table:
DEPT_ID EMP_ID DEPT_NAME
827 22 Sales
438 33 Marketing
869 46 Finance
575 52 Production
• Now, when these two relations are joined on the common column
"EMP_ID", then the resultant relation will look like:
• Employee ⋈ Department
EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME
22 Denim 28 Mumbai 827 Sales
33 Alina 25 Delhi 438 Marketing
46 Stephan 30 Bangalore 869 Finance
52 Katherine 36 Mumbai 575 Production
60 Jack 40 Noida 678 Testing
Hence, the decomposition is Lossless join decomposition.
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf
DBMS 3.pdf

More Related Content

PDF
Functional Dependency
PPT
Abstract data types
PDF
Normalization in DBMS
PPTX
Decomposition using Functional Dependency
PPTX
Row major and column major in 2 d
PPTX
Triggers
PPTX
Functional dependencies in Database Management System
PPTX
Functional Dependency
Abstract data types
Normalization in DBMS
Decomposition using Functional Dependency
Row major and column major in 2 d
Triggers
Functional dependencies in Database Management System

What's hot (20)

DOCX
Dbms practical list
PPTX
SQL Commands
PPTX
DBMS: Types of keys
PPTX
PPTX
Trees in data structures
PPTX
Referential integrity
PPTX
Relational Data Model Introduction
PPTX
Transaction states and properties
PPTX
Unit 9. Structure and Unions
PPTX
self_refrential_structures.pptx
PPT
Types Of Join In Sql Server - Join With Example In Sql Server
PDF
View & index in SQL
PPTX
SQL commands
PPT
PPT
BINARY SEARCH TREE
PPT
Branching in C
PPTX
Types of Constructor in C++
PPTX
Depth first search and breadth first searching
Dbms practical list
SQL Commands
DBMS: Types of keys
Trees in data structures
Referential integrity
Relational Data Model Introduction
Transaction states and properties
Unit 9. Structure and Unions
self_refrential_structures.pptx
Types Of Join In Sql Server - Join With Example In Sql Server
View & index in SQL
SQL commands
BINARY SEARCH TREE
Branching in C
Types of Constructor in C++
Depth first search and breadth first searching
Ad

Similar to DBMS 3.pdf (20)

PDF
PPTX
Relational Database design.pptx
PPT
DBMS-Unit-3.0 Functional dependencies.ppt
PPT
ch7-clean.ppt
PPT
DBMS MODULE-5 normalisation in database management
PDF
UNIT 4 NORMALIZATION AND QUERY OPTIMIZATION 9.pdf
PPTX
Functional Dependency.pptx
PDF
Normalization.pdf
PPTX
Functional Dependency in DBMS Enggg.pptx
PPT
Module 4- Database Management System by Navathe
PDF
transection mangemanrtin data bse mangement system .pdf
PPTX
21CSC205P DBMS UNIT IV.pptx21CSC205P DBMS UNIT IV.pptx
PPT
Unit-2 relational algebra ikgtu DBMS.ppt
PDF
DBMS unit-3.pdf
PPTX
normalaization in database management system
PPTX
Functional dependancy
PPTX
Unit 3 dbms
PPT
MODULE 3 -Normalization_1.ppt moduled in design
Relational Database design.pptx
DBMS-Unit-3.0 Functional dependencies.ppt
ch7-clean.ppt
DBMS MODULE-5 normalisation in database management
UNIT 4 NORMALIZATION AND QUERY OPTIMIZATION 9.pdf
Functional Dependency.pptx
Normalization.pdf
Functional Dependency in DBMS Enggg.pptx
Module 4- Database Management System by Navathe
transection mangemanrtin data bse mangement system .pdf
21CSC205P DBMS UNIT IV.pptx21CSC205P DBMS UNIT IV.pptx
Unit-2 relational algebra ikgtu DBMS.ppt
DBMS unit-3.pdf
normalaization in database management system
Functional dependancy
Unit 3 dbms
MODULE 3 -Normalization_1.ppt moduled in design
Ad

Recently uploaded (20)

PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
Introduction to pro and eukaryotes and differences.pptx
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
HVAC Specification 2024 according to central public works department
PDF
Trump Administration's workforce development strategy
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
advance database management system book.pdf
PPTX
20th Century Theater, Methods, History.pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
Computer Architecture Input Output Memory.pptx
Environmental Education MCQ BD2EE - Share Source.pdf
Hazard Identification & Risk Assessment .pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
History, Philosophy and sociology of education (1).pptx
Introduction to pro and eukaryotes and differences.pptx
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Practical Manual AGRO-233 Principles and Practices of Natural Farming
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Paper A Mock Exam 9_ Attempt review.pdf.
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
HVAC Specification 2024 according to central public works department
Trump Administration's workforce development strategy
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
advance database management system book.pdf
20th Century Theater, Methods, History.pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Computer Architecture Input Output Memory.pptx

DBMS 3.pdf

  • 1. Functional Dependency • The functional dependency is a relationship that exists between two attributes. It typically exists between the primary key and non-key attribute within a table. X → Y • The left side of FD is known as a determinant, the right side of the production is known as a dependent. For example: • Assume we have an employee table with attributes: Emp_Id, Emp_Name, Emp_Address. • Here Emp_Id attribute can uniquely identify the Emp_Name attribute of employee table because if we know the Emp_Id, we can tell that employee name associated with it. • Functional dependency can be written as: • Emp_Id → Emp_Name • We can say that Emp_Name is functionally dependent on Emp_Id.
  • 3. Types of Functional dependency 1. Trivial functional dependency A → B has trivial functional dependency if B is a subset of A OR EQUAL TO A i.e A ⊇ B The following dependencies are also trivial like: A → A, B → B Example: Consider a table with two columns Employee_Id and Employee_Name. {Employee_id, Employee_Name} → Employee_Id is a trivial functional dep endency as Employee_Id is a subset of {Employee_Id, Employee_Name}. Also, Employee_Id → Employee_Id and Employee_Name → Employee_Na me are trivial dependencies too.
  • 4. 2. Non-trivial functional dependency • A → B has a non-trivial functional dependency if B is not a subset of A. • When A intersection B is NULL i.e. A∩B=Ф then A → B is called as complete non-trivial. Example: • ID → Name, • Name → DOB 3.Semi Non trivial functional dependency Employee_Id → Employee_Id Employee_Name Employee_Id → Employee_Id Employee_Id → Employee_Name
  • 6. Inference Rule (IR): • The Armstrong's axioms are the basic inference rule. • Armstrong's axioms are used to conclude functional dependencies on a relational database. • The inference rule is a type of assertion. It can apply to a set of FD(functional dependency) to derive other FD. • Using the inference rule, we can derive additional functional dependency from the initial set. • The Functional dependency has 6 types of inference rule: • 1. Reflexive Rule (IR1 ) • In the reflexive rule, if Y is a subset of X, then X determines Y. • If X ⊇ Y then X → Y • Example:
  • 7. 2. Augmentation Rule (IR2 ) • The augmentation is also called as a partial dependency. In augmentation, if X determines Y, then XZ determines YZ for any Z. • If X → Y then XZ → YZ Example: • For R(ABCD), if A → B then AC → BC 3. Transitive Rule (IR3 ) • In the transitive rule, if X determines Y and Y determine Z, then X must also determine Z. • If X → Y and Y → Z then X → Z 4. Union Rule (IR4 ) • Union rule says, if X determines Y and X determines Z, then X must also determine Y and Z. • If X → Y and X → Z then X → YZ
  • 8. 5. Decomposition Rule (IR5 ) • Decomposition rule is also known as project rule. It is the reverse of union rule. • This Rule says, if X determines Y and Z, then X determines Y and X determines Z separately. • If X → YZ then X → Y and X → Z Proof: 1. X → YZ (given) 2. YZ → Y (using IR1 Rule) 3. X → Y (using IR3 on 1 and 2) 6. Pseudo transitive Rule (IR6 ) • In Pseudo transitive Rule, if X determines Y and YZ determines W, then XZ determines W. • If X → Y and YZ → W then XZ → W Proof: 1. X → Y (given) 2. WY → Z (given) 3. WX → WY (using IR2 on 1 by augmenting with W) 4. WX → Z (using IR3 on 3 and 2)
  • 22. Relational Decomposition • When a relation in the relational model is not in appropriate normal form then the decomposition of a relation is required. • In a database, it breaks the table into multiple tables. • If the relation has no proper decomposition, then it may lead to problems like loss of information. • Decomposition is used to eliminate some of the problems of bad design like anomalies, inconsistencies, and redundancy. Types of Decomposition 1.Lossless Decomposition 2.Dependency Preserving
  • 24. Dependency Preserving • It is an important constraint of the database. • In the dependency preservation, at least one decomposed table must satisfy every dependency. • If a relation R is decomposed into relation R1 and R2, then the dependencies of R either must be a part of R1 or R2 or must be derivable from the combination of functional dependencies of R1 and R2. • For example, suppose there is a relation R (A, B, C, D) with functional dependency set (A->BC). The relational R is decomposed into R1(ABC) and R2(AD) which is dependency preserving because FD A->BC is a part of relation R1(ABC).
  • 29. Lossless Decomposition • If the information is not lost from the relation that is decomposed, then the decomposition will be lossless. • The lossless decomposition guarantees that the join of relations will result in the same relation as it was decomposed. • The relation is said to be lossless decomposition if natural joins of all the decomposition give the original relation. Example: EMPLOYEE_DEPARTMENT table: EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME 22 Denim 28 Mumbai 827 Sales 33 Alina 25 Delhi 438 Marketing 46 Stephan 30 Bangalore 869 Finance 52 Katherine 36 Mumbai 575 Production 60 Jack 40 Noida 678 Testing
  • 30. The above relation is decomposed into two relations EMPLOYEE and DEPARTMENT EMPLOYEE table: EMP_ID EMP_NAME EMP_AGE EMP_CITY 22 Denim 28 Mumbai 33 Alina 25 Delhi 46 Stephan 30 Bangalore 52 Katherine 36 Mumbai 60 Jack 40 Noida DEPARTMENT table: DEPT_ID EMP_ID DEPT_NAME 827 22 Sales 438 33 Marketing 869 46 Finance 575 52 Production
  • 31. • Now, when these two relations are joined on the common column "EMP_ID", then the resultant relation will look like: • Employee ⋈ Department EMP_ID EMP_NAME EMP_AGE EMP_CITY DEPT_ID DEPT_NAME 22 Denim 28 Mumbai 827 Sales 33 Alina 25 Delhi 438 Marketing 46 Stephan 30 Bangalore 869 Finance 52 Katherine 36 Mumbai 575 Production 60 Jack 40 Noida 678 Testing Hence, the decomposition is Lossless join decomposition.