- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Partial Dependency in DBMS
What is Partial Dependency?
Partial Dependency occurs when a non-prime attribute is functionally dependent on part of a candidate key.
The 2nd Normal Form (2NF) eliminates the Partial Dependency.
Let us see an example −
Example
<StudentProject>
StudentID | ProjectNo | StudentName | ProjectName |
S01 | 199 | Katie | Geo Location |
S02 | 120 | Ollie | Cluster Exploration |
In the above table, we have partial dependency; let us see how −
The prime key attributes are StudentID and ProjectNo, and
StudentID = Unique ID of the studentStudentName = Name of the studentProjectNo = Unique ID of the projectProjectName = Name of the project |
As stated, the non-prime attributes i.e. StudentName and ProjectName should be functionally dependent on part of a candidate key, to be Partial Dependent.
The StudentName can be determined by StudentID, which makes the relation Partial Dependent.
The ProjectName can be determined by ProjectNo, which makes the relation Partial Dependent.
Therefore, the <StudentProject> relation violates the 2NF in Normalization and is considered a bad database design.
To remove Partial Dependency and violation on 2NF, decompose the tables −
<StudentInfo>
StudentID | ProjectNo | StudentName |
S01 | 199 | Katie |
S02 | 120 | Ollie |
<ProjectInfo>
ProjectNo | ProjectName |
199 | Geo Location |
120 | Cluster Exploration |
Now the relation is in 2nd Normal form of Database Normalization.