0% found this document useful (0 votes)
25 views7 pages

Alaanoor Db12 Report Revised

Uploaded by

31.1.2002ar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views7 pages

Alaanoor Db12 Report Revised

Uploaded by

31.1.2002ar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/364309560

Functional Dependency

Technical Report · September 2021

CITATIONS READS
0 753

1 author:

Alaa Noor
Universität Potsdam
9 PUBLICATIONS 44 CITATIONS

SEE PROFILE

All content following this page was uploaded by Alaa Noor on 11 October 2022.

The user has requested enhancement of the downloaded file.


Functional Dependency

Alaa Noor

University of Potsdam, Department of Computer Science, An der Bahn 2, 14476,


Potsdam, Germany
[email protected]

Abstract. In relational database design theory upto BCNF, functional


dependency plays an important role. In other words, it is the heart of re-
lational database. Functional dependency is used in many data manage-
ment tasks such as data cleansing, data integration, data analysis etc. It
also plays a vital role in schema normalization. Normalization is the pro-
cess which rectifies the database design in order to ensure that unusual
characteristics or redundancy do not exist in the database, thus reduc-
ing data redundancy. Furthermore there are certain rules of functional
dependency and also types of functional dependency which is discussed
in this paper.

Keywords: Functional Dependency · Normalization · BCNF.

1 Introduction

Functional Dependency (FDs) is the central part of relational database design


theory. FDs are a generalization of keys [1]. It is the relationship that exists when
one attribute uniquely determines another attribute. It mainly exists between a
primary key and non-key attribute within a table [3]. A primary key is typically
a column in a database table which uniquely identify tuples of that table. In
other words, primary key must have unique values [6].
A functional dependency is expressed by an ” → ”. Such as according to the
below functional dependency, it can be written that B is functionally dependent
on A.
A→B
Here the left hand side is known as determinant whereas the right hand side is
known as the dependent.

Table 1. Student Table.

Student ID Name Age City


01 Alaa 21 Potsdam
02 Iftekhar 25 Potsdam
03 Aziha 22 Berlin
2 Alaa Noor

For instance, from (Table 1), here if we know the value of Student ID, we can
obtain the Name, Age and City of that student. By this, we can say that the
City, Name, and Age are functionally dependent on Student ID. The functional
dependency can be written as: Student ID → Name, Age, City.

2 Description

2.1 Armstrong’s Axioms- Inference Rules

1. Reflexive rule: If B is a subset of A, then by reflexivity rule A→B holds.


2. Augmentation rule: It is also known as a partial dependency, it says if
A→B holds, then AC→BC for any attribute C also holds.
3. Transitivity rule: This rule is very much similar to the transitive rule in
algebra if A→B holds and B→C holds, then A→C also holds [1, 2].

2.2 Types of Functional Dependency

There are three types of functional dependency, which are:


– Transitive Dependency
– Trivial Functional Dependency
– Non-trivial Functional Dependency
Fig. 1 shows the types of functional dependency.

Fig. 1. Types of Functional Dependency


Functional Dependency 3

Transitive Dependency If a functional dependency is indirectly formed by


two functional dependencies it is known as transitive functional dependency [7].
P→ R is a transitive dependency if the following three functional dependencies
hold true:
– P→Q
– Q does not → P
– Q→R
A transitive dependency can only occur in a relation of three or more attributes.
This dependency helps us normalizing the database in 3NF (3rd Normal Form).

Table 2. Book Table.

Book Author Author age


Game of Thrones George R. R. Martin 66
Harry Potter J.K. Rowling 49
Dying of the Light George R. R. Martin 66

From Table. 2 we can determine the following dependencies:


– {Book} → {Author} (Author’s name can be determined if we know the name
of the book.)
– {Author} does not → {Book}
– {Author} → {Author Age}
Therefore after applying the rule of transitive dependency:
– {Book} → {Author Age} will hold true, in other words the author’s age can
be determined if we know the name of the book [5].

Trivial Functional Dependency The dependency of an attribute on a set


of attributes is known as trivial functional dependency if the set of attributes
includes that attribute [8]. Symbolically:
– A → B is trivial functional dependency if B is a subset of A.
– The following dependencies are also trivial: A → A and B → B
According to Table. 3 the trivial dependencies are:
– {Company Id, Company Name} → {Company Id} is a trivial functional de-
pendency as Company Id is a subset of {Company Id, Company Name}.
– Also, Company Id → Company Id & Company Name → Company Name
are trivial dependencies too.
4 Alaa Noor

Table 3. Company Table.

Company ID Comapny Name


C2 Apple
C3 Facebook
C4 Google

Non-trivial Functional Dependency A nontrivial functional dependency


occurs when A → B holds true where B is not a subset of A [3].
From Table. 3, Company Id → Company Name is non-trivial functional depen-
dency since Company Name is not a subset of Company Id.

Any FD such as {A1,...,An → B1,...,Bm} will cause redundant storage unless


{A1,..,An} is a key, so that each combination of attribute values for {A1,...,An}
can occur only once. Thus avoid (proper) FDs by transforming them into key
constraints. This is what normalization does. Therefore BCNF is used here.

2.3 Boyce-Codd Normal Form


Boyce-Codd Normal Form is a higher version of the Third Normal form. This
form deals with certain type of anomaly that is not handled by 3NF. A 3NF
table which does not have multiple overlapping candidate keys is said to be in
BCNF [9]. A relational schema R is considered to be in Boyce–Codd Normal
Form (BCNF) if, for every one of its dependencies A → B, one of the following
conditions holds true:
•A → B is a trivial functional dependency
•A relation R is in BCNF if and only if: whenever there is a nontrivial FD
{A1,...,An → B1,...,Bm} for R, it is the case that {A1, A2,..,An} is a superkey
for R.
That is, the left side of every nontrivial FD must be a superkey [1].

Table 4. Author Table.

Author Nationality Book Title Genre Number of pages


William Shakespeare English The Tempest Comedy 215
Emily Bronte Irish Wuthering Heights Gothic 540
Jeffrey Ullman American Database Systems Textbook 500
Jennifer Widom American Database Systems Textbook 500

Table 4 is not in BCNF. The non-trivial functional dependencies in the table


are:
•author → nationality
Functional Dependency 5

•book title → genre, number of pages

Table 5. Author1 Table.

Author Nationality
William Shakespeare English
Emily Bronte Irish
Jeffrey Ullman American
Jennifer Widom American

After applying BCNF, the table is decomposed into three tables. The functional
dependencies for this schema are the same as before:
•author → nationality
•book title → genre, number of pages
The key of the first table is author. The key of the second table is author,
book title. The key of the third table is book title. There are no functional
dependencies violating the BCNF rules, so the schema is in Boyce-Codd Normal
Form [10].

Table 6. Author2 Table.

Author Book Title


William Shakespeare The Tempest
Emily Bronte Wuthering Heights
Jeffrey Ullman Database Systems
Jennifer Widom Database Systems

Table 7. Author3 Table.

Book Title Genre Number of pages


The Tempest Comedy 215
Wuthering Heights Gothic 540
Database Systems Textbook 500

3 Related Work

Since functional dependency is an important part of database. Identifying func-


tional dependency has become quite challenging. A lot of research is going on
to discover the functional dependencies in the database table. Many algorithms
6 Alaa Noor

have been designed and proposed to discover functional dependency. For exam-
ple, the researchers in the paper [11] proposed a hybrid approach to discover
functional dependency.

4 Conclusion
Functional Dependency helps in getting rid of data redundancy where the same
values should not be repeated at multiple locations in the same database table.
It supports in maintaining the quality of data in a database. Functional Depen-
dency allows clearly defined meanings and constraints of databases. It assists in
recognizing the bad designs of a database. Lastly the facts about the database
design is expressed by functional dependency [2, 4].

References
1. H. Garcia-Molina, J. Ullman, and J.Widom. Database Systems: The Complete
Book. Prentice Hall Press, second edition, 2008.
2. Functional Dependency in DBMS, https://www.guru99.com/dbms-functional-
dependency.html. Last accessed 11 August 2021.
3. Functional Dependency, https://www.slideshare.net/vj9/function-dependency-and-
types-example.
4. Functional Dependencies, https://www.tutorialandexample.com/functional-
dependencies/. Last accessed 9 August 2021.
5. Database Management, https://www.slideshare.net/MrinalDev1/data-base-
management-system-2-123069344.
6. Data Normalization, https://jameskle.com/writes/data-normalization/. Last ac-
cessed 12 August 2021.
7. Transitive Dependency in DBMS, https://beginnersbook.com/2015/04/transitive-
dependency-in-dbms/. Last accessed 12 August 2021.
8. Trivial Functional Dependency, https://beginnersbook.com/2015/04/trivial-
functional-dependency-in-dbms/. Last accessed 12 August 2021.
9. Normalization of Database, https://www.studytonight.com/dbms/database-
normalization.php. Last accessed 10 August 2021.
10. BCNF, https://vertabelo.com/blog/boyce-codd-normal-form-bcnf/. Last accessed
12 August 2021.
11. T. Papenbrock and F. Naumann. A hybrid approach to functional dependency
discovery. In Proceedings of the International Conference on Management of Data
(SIGMOD), pages 821–833, 2016.

View publication stats

You might also like