

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is functional dependency in DBMS?
Functional dependencies are the constraints that are derived from the meaning and interrelationship of the data.
Definition − Let R is a relation schema with n attributes A1, A2,…..An. A functional dependency, denoted by X->Y, between two sets of attributes X and Y that are subsets of R species a constraint on the possible tuples that can form a relation state r of R.
The constraint is that, for any two tuples t1 and t2 in r that have t1[X]=t2[X], they must have t1[Y]=t2[Y].
Y depends on X or Y is determined by X or Y is functional dependent on X. Similarly X determines Y.
If X is the candidate key of R then X->Y for any subset of attributes Y of R.
If X->Y in R, it does not mean whether or not Y->X in R.
Relation extension r(R) that satisfy the FD constraints are called legal relation states (or legal extensions) of R.
Example 1
Given below is an example of functional dependency in database management system (DBMS) −
SSN->ENAME read as SSN functionally dependent on ENAME or SSN determines ENAME PNUMBER->{PNAME,PLOCATION} (PNUMBER determines PNAME and PLOCATION) {SSN,PNUMBER}->HOURS (SSN and PNUMBER combinedly determines HOURS)
Output
You will get the following result −
Example 2
Consider another example: BOOK table.
Bookid | Bname | Author | Price |
---|---|---|---|
B1 | Database | Korth | 400 |
B2 | Database | Navathe | 300 |
B3 | Datastructures | Patel | 200 |
B4 | Oops | Patel | 200 |
Here,
Bookid->Bname {bookid determines Bname}
Bname ->author {bookname does not determine author, because same bname has different authors}
Author->price {Author determines price}
Note − There is no algorithm to identify functional dependency. We have to use our commonsense and judgment to identify functional dependency.
Type of dependencies
The different types of dependencies on the tables are as follows −
Multivalued Attributes
It is also called as repeating groups. A non-key attribute or groups of non-key attributes the values of which are not uniquely identified by the value of primary key or its part.
Partial dependency
An attribute that is partial dependency when an non-key attribute is determined by a part, but not on its whole of a composite primary key.
Transitive dependency
Transitive dependency means when a non-key attribute determines another non-key attribute.
- Related Questions & Answers
- What is functional dependency and transitive dependency (DBMS)?
- Functional dependency in DBMS
- Fully-functional dependency in DBMS
- What is Multivalued Dependency (DBMS)?
- What is Transitive dependency in DBMS?
- What is multivalued dependency in DBMS?
- Partial Dependency in DBMS
- Transitive dependency in DBMS
- Multivalued dependency in DBMS
- Join dependency in DBMS
- Explain join dependency in DBMS
- Explain about partial and fully functional dependency
- What is Data Dependency?
- What is dependency injection in PHP?
- what is functional testing in QA