Module-3
Module-3
By:
Dr. Nagendra Panini Challa
Assistant Professor, Senior Grade 2
SCOPE, VIT-AP University, India
AGENDA
Functional dependency (FD)
Closure of FD, Closure of Attributes
Cover, Equivalence of FD
Canonical cover
Key generation
Normalization
Desirable properties of decomposition
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.
Functional Dependencies in a relation are dependent on the domain of the relation. Consider the
STUDENT relation given in Table 1
Step-1 : Add attributes present on the LHS of the first functional dependency to the
closure.
{Roll_no}+ = {Roll_No}
Step-2 : Add attributes present on the RHS of the original functional dependency to the
closure.
{Roll_no}+ = {Roll_No, Marks}
Step-3 : Add the other possible attributes which can be derived using attributes present
on the RHS of the closure. So Roll_No attribute cannot functionally determine any attribute
but Name attribute can determine other attributes such as Marks and Location using
2nd Functional Dependency(Name, Marks, Location).
Database Management Systems (DBMS), SCOPE, VIT-AP University, India 02/03/2025 14
Therefore, complete closure of Roll_No will be :
{Roll_no}+ = {Roll_No, Marks, Name, Location}
Similarly, we can calculate closure for other attributes too i.e “Name”.
Step-1 : Add attributes present on the LHS of the functional dependency to the closure.
{Name}+ = {Name}
Step-2 : Add the attributes present on the RHS of the functional dependency to the closure.
{Name}+ = {Name, Marks, Location}
Step-3 : Since, we don’t have any functional dependency where “Marks or Location”
attribute is functionally determining any other attribute , we cannot add more attributes to
the closure. Hence complete closure of Name would be :
{Name}+ = {Name, Marks, Location}
NOTE : We don’t have any Functional dependency where marks and location can
functionally determine any attribute. Hence, for those attributes we can only add the
attributes themselves in their closures.
Database Management Systems (DBMS), SCOPE, VIT-AP University, India 02/03/2025 15
Therefore
{Marks}+ = {Marks}
and
{Location}+ = { Location}
Example-2 : Consider a relation R(A,B,C,D,E) having below mentioned functional
dependencies.
FD1 : A BC
FD2 : C B
FD3 : D E
FD4 : E D
Now, we need to calculate the closure of attributes of the relation R. The closures will be:
{A}+ = {A, B, C}
{B}+ = {B}
{C}+ = {B, C}
{D}+ = {D, E}
{E}+ = {E,D}
Database Management Systems (DBMS), SCOPE, VIT-AP University, India 02/03/2025 16
Closure Of Functional Dependency : Calculating Candidate Key
“A Candidate Key of a relation is an attribute or set of attributes that can determine the
whole relation or contains all the attributes in its closure."
Let’s try to understand how to calculate candidate keys.
NOTE : Any relation “R” can have either single or multiple candidate keys.
As all FDs in set FD2 also hold in set FD1, FD1 ⊃ FD2 is true.
Step 3. As FD2 ⊃ FD1 and FD1 ⊃ FD2 both are true FD2 =FD1 is true. These two FD sets
are semantically equivalent.
Step 3. In this case, FD2 ⊃ FD1 and FD2 ⊄ FD1, these two FD sets are not semantically
equivalent.
Deletion Anomaly: The delete anomaly refers to the situation where the
deletion of data results in the unintended loss of some other important
data.
Disadvantages of Normalization
You cannot start building the database before knowing what the user needs.
The performance degrades when normalizing the relations to higher normal forms, i.e.,
4NF, 5NF.
It is very time-consuming and difficult to normalize relations of a higher degree.
Careless decomposition may lead to a bad database design, leading to serious problems.
A relation will be in 3NF if it is in 2NF and not contain any transitive partial dependency.
3NF is used to reduce the data duplication. It is also used to achieve the data integrity.
If there is no transitive dependency for non-prime attributes, then the relation must be in
third normal form.
A relation is in third normal form if it holds atleast one of the following conditions for every
non-trivial function dependency X → Y.
X is a super key.
Y is a prime attribute, i.e., each element of Y is part of some candidate key.