Categories: DBMS

Third Normal Form(3NF)

What is Third Normal Form?

The third step in Normalization is 3NF. For a table to be in third normal form, it needs to satisfy 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.

Note:

  • If a relation is in 2NF and does not contain any transitive partial dependencies, it will be in 3NF.
  • The amount of duplicate data is decreased using 3NF. Additionally, it is employed to ensure data integrity.
  • If there is no transitive dependency for non-prime attributes, then the relation must be in third normal form.
What is Transitive Dependency?

A transitive dependency, as used in database management systems (DBMS), is a relationship between three or more attributes in a table such that if attribute A depends on attribute B and attribute C depends on attribute B, then attribute A also depends on attribute C. This means that the value of attribute A can be determined indirectly by looking at the value of attribute C.

For instance,

Consider a table Employee_Info with the following attributes: Employee_ID, Employee_Name, Employee_Department, and Department_Location. This table has a transitive dependency between Employee_Department and Department_Location because the location of a department can be determined indirectly through the department of an employee.

To remove this dependency, we can split the table into two tables: “Employee” and “Department“. The Employee table would have the following attributes: Employee_ID, Employee_Name, and Department_ID. The Department table would have the following attributes: Department_ID, Department_Name, and Department_Location.

This makes it easier to maintain the data and prevents data inconsistencies or redundancies that can occur with transitive dependencies.

Note: also read about Second Normal Form(2NF)

Follow Me

Please follow me to read my latest post on programming and technology if you like my post.

https://www.instagram.com/coderz.py/

https://www.facebook.com/coderz.py

Share
Published by
Rabecca Fatima

Recent Posts

Generate Parenthesis | Intuition + Code | Recursion Tree | Backtracking | Java

Problem Statement: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example…

2 months ago

Square Root of Integer

Given an integer A. Compute and return the square root of A. If A is…

1 year ago

Build Array From Permutation

Given a zero-based permutation nums (0-indexed), build an array ans of the same length where…

1 year ago

DSA: Heap

A heap is a specialized tree-based data structure that satisfies the heap property. It is…

1 year ago

DSA: Trie

What is a Trie in DSA? A trie, often known as a prefix tree, is…

1 year ago

Trees: Lowest Common Ancestor

What is the Lowest Common Ancestor? In a tree, the lowest common ancestor (LCA) of…

1 year ago