A functional dependency is simply a constraint between two sets of attributes from the database. A functional dependency is used in normalization. A functional dependency is denoted by an arrow → .The functional dependency of A on B is represented by A → B. Functional Dependency plays a vital role in finding the difference between good and bad database design.

A→B

Above Functional dependency is pronounced as :

- A determines B
- A functionally determines B
- B is functionally dependent on A
- For a given value of A, we can functionally determine the value of B.

A and B can be a set of attributes, they need not be single attributes always.

Example : AB→B, A→ ACB etc.

With a given relation, we are also given a set of Functional dependencies most of the time according to the semantics of the database design.

Most interesting thing is that we can yield more **additional functional dependencies** by applying some rules on the functional dependencies given.

**Example:**

A relation R(AB) is given with functional dependencies F : { A→B, B→A }. Find out the additional functional dependencies derivable from the given functional dependencies on the relation R.

**Explanation:**

**Step-1:** Finding out the set of possible functional dependencies:

Assume the functional dependency as A→B. A functional dependency will have Left side that is A here and Right side that is B here.

So the valid attribute we can have in either side is given below:

Therefore, number of functional dependencies possible = 4*4 = 16

**Step-2:** Listing out all possible functional dependencies with 2 attributes AB of the relation R:

Following are the list of all 16 possible functional dependencies with 2 attributes AB of the relation R:

**Step-3:** Checking if the possible functional dependencies are derivable or not:

In this step, we check if the possible functional dependencies are derivable by a given set of functional dependencies or not, by using the closure set of attributes.

**Φ → Φ :** derivable since its a trivial functional dependency.

**A→Φ :** derivable since phi is a subset of A

**A→A :** derivable since its a trivial functional dependency.

**A→B :** derivable from the given functional dependency A→B.

**A→AB :** derivable since the closure set of A gives AB.

**B→Φ :** derivable since phi is a subset of B

**B→A :** derivable from the given functional dependency B→A.

**B→B :** derivable since its a trivial functional dependency.

**B→AB :** derivable since the closure set of B gives AB.

**AB→Φ :** derivable since its a trivial functional dependency.

**AB→A :** derivable since its a trivial functional dependency.

**AB→B :** derivable since its a trivial functional dependency.

**AB→AB :** derivable since its a trivial functional dependency.

The rest of the possible dependencies are not valid.

Therefore, the total number of additional functional dependencies that can be determined by the given functional dependencies A→B and B→A on relation R is 13, including A→B, B→A are listed below :

Φ→Φ, A→Φ, A→A, A→B, A→AB, B→Φ, B→A, B→B, B→AB, AB→Φ, AB→A, AB→B, AB→AB

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the **DSA Self Paced Course** at a student-friendly price and become industry ready.

## Recommended Posts:

- Finding the candidate keys for Sub relations using Functional Dependencies
- Finding Attribute Closure and Candidate Keys using Functional Dependencies
- Equivalence of Functional Dependencies
- Allowed Functional Dependencies (FD) in Various Normal Forms (NF)
- Canonical Cover of Functional Dependencies in DBMS
- Relation Schema in DBMS
- How to find the highest normal form of a relation
- Additional Functions in CQL (Cassandra Query Language)
- Functional Completeness in Digital Logic
- Functional Dependency and Attribute Closure
- Armstrong's Axioms in Functional Dependency in DBMS
- Finding DBA from given IP address
- Finding Network ID of a Subnet (using Subnet Mask)
- Examples of Data Link Layer Protocols

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.