Types of Functional Dependencies in DBMS
Types of Functional Dependencies in DBMS
42 abc 17
43 pqr 18
44 xyz 18
Here, {roll_no, name} → name is a trivial functional dependency, since the
dependent name is a subset of determinant set {roll_no, name}. Similarly, roll_no →
roll_no is also an example of trivial functional dependency.
2. Non-trivial Functional Dependency
In Non-trivial functional dependency, the dependent is strictly not a subset of the
determinant. i.e. If X → Y and Y is not a subset of X, then it is called Non-trivial
functional dependency.
Example:
roll_no name age
42 abc 17
43 pqr 18
44 xyz 18
Here, roll_no → name is a non-trivial functional dependency, since the
dependent name is not a subset of determinant roll_no. Similarly, {roll_no, name} →
age is also a non-trivial functional dependency, since age is not a subset of {roll_no,
name}
3. Multivalued Functional Dependency
In Multivalued functional dependency, entities of the dependent set are not
dependent on each other. i.e. If a → {b, c} and there exists no functional
dependency between b and c, then it is called a multivalued functional dependency.
For example,
roll_no name age
42 abc 17
43 pqr 18
44 xyz 18
45 abc 19
Here, roll_no → {name, age} is a multivalued functional dependency, since the
dependents name & age are not dependent on each other(i.e. name → age or age →
name doesn’t exist !)
4. Transitive Functional Dependency
In transitive functional dependency, dependent is indirectly dependent on determinant. i.e.
If a → b & b → c, then according to axiom of transitivity, a → c. This is a transitive
functional dependency.
For example,
nam
enrol_no e dept building_no
42 abc CO 4
43 pqr EC 2
44 xyz IT 1
45 abc EC 2
Here, enrol_no → dept and dept → building_no. Hence, according to the axiom of
transitivity, enrol_no → building_no is a valid functional dependency. This is an indirect
functional dependency, hence called Transitive functional dependency.
5. Fully Functional Dependency
In full functional dependency an attribute or a set of attributes uniquely determines another
attribute or set of attributes. If a relation R has attributes X, Y, Z with the dependencies X-
>Y and X->Z which states that those dependencies are fully functional.
6. Partial Functional Dependency
In partial functional dependency a non key attribute depends on a part of the composite
key, rather than the whole key. If a relation R has attributes X, Y, Z where X and Y are the
composite key and Z is non key attribute. Then X->Z is a partial functional dependency in
RBDMS.
Advantages of Functional Dependencies
Functional dependencies having numerous applications in the field of database
management system. Here are some applications listed below:
1. Data Normalization
Data normalization is the process of organizing data in a database in order to minimize
redundancy and increase data integrity. Functional dependencies play an important part in
data normalization. With the help of functional dependencies we are able to identify the
primary key, candidate key in a table which in turns helps in normalization.
2. Query Optimization
With the help of functional dependencies we are able to decide the connectivity between
the tables and the necessary attributes need to be projected to retrieve the required data
from the tables. This helps in query optimization and improves performance.
3. Consistency of Data
Functional dependencies ensures the consistency of the data by removing any
redundancies or inconsistencies that may exist in the data. Functional dependency ensures
that the changes made in one attribute does not affect inconsistency in another set of
attributes thus it maintains the consistency of the data in database.
4. Data Quality Improvement
Functional dependencies ensure that the data in the database to be accurate, complete and
updated. This helps to improve the overall quality of the data, as well as it eliminates
errors and inaccuracies that might occur during data analysis and decision making, thus
functional dependency helps in improving the quality of data in database.
Normalization of DBMS
In database management systems (DBMS), normal forms are a series of guidelines that
help to ensure that the design of a database is efficient, organized, and free from data
anomalies. There are several levels of normalization, each with its own set of guidelines,
known as normal forms.
Normal forms help to reduce data redundancy, increase data consistency, and improve
database performance. However, higher levels of normalization can lead to more complex
database designs and queries. It is important to strike a balance between normalization and
practicality when designing a database.
Advantages of Normal Form
Reduced data redundancy: Normalization helps to eliminate duplicate data in
tables, reducing the amount of storage space needed and improving database
efficiency.
Improved data consistency: Normalization ensures that data is stored in a
consistent and organized manner, reducing the risk of data inconsistencies and errors.
Simplified database design: Normalization provides guidelines for organizing
tables and data relationships, making it easier to design and maintain a database.
Improved query performance: Normalized tables are typically easier to search and
retrieve data from, resulting in faster query performance.
Easier database maintenance: Normalization reduces the complexity of a database
by breaking it down into smaller, more manageable tables, making it easier to add,
modify, and delete data.
BCNF
BCNF (Boyce-Codd Normal Form) is just a advanced version of Third Normal Form.
Here we have some additional rules than Third Normal Form. The basic condition for any
relation to be in BCNF is that it must be in Third Normal Form.
We have to focus on some basic rules that are for BCNF:
1. Table must be in Third Normal Form.
2. In relation X->Y, X must be a superkey in a relation.
Types of Decomposition
There are two types of Decomposition:
Lossless Decomposition
Lossy Decomposition
Lossless Decomposition
The process in which where we can regain the original relation R with the help of joins
from the multiple relations formed after decomposition. This process is termed as lossless
decomposition. It is used to remove the redundant data from the database while retaining
the useful information. The lossless decomposition tries to ensure following things:
While regaining the original relation, no information should be lost.
If we perform join operation on the sub-divided relations, we must get the original
relation.
Example:
There is a relation called R(A, B, C)
A B C
55 16 27
48 52 89
Now we decompose this relation into two sub relations R1 and R2
R1(A, B)
A B
55 16
48 52
R2(B, C)
B C
16 27
52 89
After performing the Join operation we get the same original relation
A B C
55 16 27
48 52 89
Lossy Decomposition
As the name suggests, lossy decomposition means when we perform join operation on the
sub-relations it doesn’t result to the same relation which was decomposed. After the join
operation, we always found some extraneous tuples. These extra tuples genrates difficulty
for the user to identify the original tuples.
Example:
We have a relation R(A, B, C)
A B C
1 2 1
2 5 3
3 3 3
Now , we decompose it into sub-relations R1 and R2
R1(A, B)
A B
1 2
2 5
3 3
R2(B, C)
B C
2 1
5 3
3 3
Now After performing join operation
A B C
1 2 1
2 5 3
2 3 3
3 5 3
3 3 3
Properties of Decomposition
Lossless: All the decomposition that we perform in Database management system
should be lossless. All the information should not be lost while performing the join
on the sub-relation to get back the original relation. It helps to remove the redundant
data from the database.
Dependency Preservation: Dependency Preservation is an important technique in
database management system. It ensures that the functional dependencies between
the entities is maintained while performing decomposition. It helps to improve the
database efficiency, maintain consistency and integrity.
Lack of Data Redundancy: Data Redundancy is generally termed as duplicate data
or repeated data. This property states that the decomposition performed should not
suffer redundant data. It will help us to get rid of unwanted data and focus only on
the useful data or information.