# Equivalence of Functional Dependencies | DBMS

In this tutorial, we are going to learn about the equivalence of functional dependencies in database management system.
Submitted by Anushree Goswami, on September 01, 2019

Equivalence of Functional dependencies states that, if the relations of different Functional dependencies sets are given, then we have to find out whether one Functional dependency set is a subset of other given set or both the sets are equal.

To find out whether one Functional dependency set is a subset of other given set or both the sets are equal.

Suppose R1 and R2 are two Functional dependencies sets for a relation R.

1. If all Functional dependencies of R1 can be derived from Functional dependencies present in R2, we can say that R2 is a subset of R1 (R2 ⊃ R1).
2. If all Functional dependencies of R2 can be derived from Functional dependencies present in R1, we can say that R1 is a subset of R2 (R1 ⊃ R2).
3. If 1 and 2 both are satisfied, then R1 = R2.

### Case 1) Determining Whether R2 ⊃ R1 or not

Steps are followed to determine whether R2 is a subset of R1 (R2 ⊃ R1) or not,

Step 1)

• Take into consideration, the functional dependencies of set R1.
• For every functional dependency P→ Q, find by using the functional dependencies of set R1, the closure of P.

Step 2)

• Take into consideration, the functional dependencies of set R2.
• For every functional dependency P→ Q, find by using the functional dependencies of set R2, the closure of P.

Step 3)

• Compare the results of Step 1 and Step 2.
• If the functional dependency of set R2 has determined all those attributes that were determined by the functional dependencies of set R1, then it means R2 ⊃ R1.
• Thus, we conclude R2 is a subset of R1 (R2 ⊃ R1) otherwise not.

### Case 2) Determining Whether R1 ⊃ R2 or not

Steps are followed to determine whether R1 is a subset of R2 (R1 ⊃ R2),

Step 1)

• Take into consideration the functional dependencies of set R2.
• For every functional dependency P → Q, find by using the functional dependencies of set R2, the closure of P.

Step 2)

• Take into consideration the functional dependencies of set R1.
• For every functional dependency P → Q, find by using the functional dependencies of set R1, the closure of P.

Step 3)

• Compare the results of Step 1 and Step 2.
• If the functional dependency of set R1 has determined all those attributes that were determined by the functional dependencies of set R2, then it means R1 ⊃ R2.
• Thus, we conclude that R1 is a subset of R2 (R1 ⊃ R2) otherwise not.

### Case 3) Determining Whether Both R1 and R2 satisfy each other or not

• If R2 is a subset of R1 and R1 is a subset of R2, then both R1 and R2 satisfied each other.
• Thus, if both the above cases satisfied, we conclude that R1 = R2.

## Example based on Equivalence of Functional Dependencies

Q) A relation R (P, Q, U, S, and T) is having two functional dependencies sets R1 and R2, which is shown as

```    Set R1:         Set R2:
P → C           P → QU
PQ → U          S → PT
S → T
```

Solution...

Case 1) Determining Whether R2 ⊃ R1 or not

Step 1)

• (P)+ = {P, Q, U} // closure of left side of P → QU using set R1.
• (S)+ = {P, Q, U, S, T} // closure of left side of S → PT using set R1.

Step 2)

• (P)+ = {P, Q, U} // closure of left side of P → QU using set R2.
• (S)+ = {P, Q, U, S, T} // closure of left side of S → PT using set R2.

Step 3)

Comparing the results of Step 1 and Step 2, we find,

• Functional dependencies of set R2 can determine all the attributes which have been determined by the functional dependencies of set R1.
• Thus, we conclude R2 is a subset of R1 i.e. R2 ⊃ R1.

Case 2) Determining Whether R1 ⊃ R2 or not

Step 1)

• (P)+ = {P, Q, U} // closure of left side of P→ Q using set R2.
• (PQ)+ = {P, Q, U} // closure of left side of PQ → U using set R2.
• (S)+ = {P, Q, U, S, T} // closure of left side of S → PU and S → T using set R2.

Step 2)

• (P)+ = {P, Q, U} // closure of left side of P→ Q using set R1.
• (PQ)+ = {P, Q, U} // closure of left side of PQ → U using set R1.
• (S)+ = {P, Q, U, S, T} // closure of left side of S → PU and S → T using set R1.

Step 3)

Comparing the results of Step 1 and Step 2, we find,

• Functional dependencies of set R1 can determine all the attributes which have been determined by the functional dependencies of set R2.
• Thus, we conclude R1 is a subset of R2 i.e. R1 ⊃ R2.

Case 3) Determining Whether Both R1 and R2 satisfy each other or not

• From Step 1, we conclude R2 ⊃ R1.
• From Step 2, we conclude R1 ⊃ R2.
• Thus, we conclude that both R1 and R2 satisfied each other i.e. R1 = R2.

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates