• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » Database » Rdbms » Third Normal Form (3NF)
Next →
← Prev

Third Normal Form (3NF)

By Dinesh Thakur

A relation R is in Third Normal Form (3NF) if and only if the following conditions are satisfied simultaneously:
1. R is already in 2NF
2. No nonprime attribute is transitively dependent on the key.
Another way of expressing the conditions for Third Normal Form is as follows:
1. R is already in 2NF
2. No nonprime attribute functionally determines any other nonprime attribute.
These two sets of conditions are equivalent.

As these two definitions of 3NF imply, the objective of transforming relations into 3NF is to remove all transitive dependencies. So, first we are going to explain the concept of transitive dependency.

We’ll be covering the following topics in this tutorial:

  • Transitive Dependencies
  • Rule to transform a relation into Third Normal Form
  • Removal of anomalies of Second Normal form

Transitive Dependencies

Assume that A, Band C are the set of attributes of a relation R and following functional dependencies are satisfied simultaneously: A –>B, B -/->A (B not functionally depends A) B–>A, A–>C and C-/->A (C not functionally depends A). Observe that C –> B is neither prohibited nor required. If all these conditions are true, we will say that attribute C is transitively dependent on attribute A. It should be clear that these functional dependencies determine the conditions for having a transitive dependency of attribute C on A. If any of these functional dependencies are not satisfied then attribute C is not transitively dependent on attribute A.

The figure shown below summarizes these conditions. In this diagram the arrows are equivalent to the symbol “-” that we use for denoting functional dependencies.

Transitive Dependence

Notice that the functional dependency A –> C may not be explicitly indicated but it holds true due to the Transitivity axiom. The requirements that B -/->A (B not functionally depends A) and C -/-> A (C not functionally depends A) are necessary to ensure that attributes A and B are nonprime attributes.

Rule to transform a relation into Third Normal Form

To transform a 2NF relation into a 3NF we will follow the approach indicated by figure. In this figure assume that any FD not implicitly indicated does not hold. An asterisk indicates the key attribute and the arrows denote functional dependencies. The dashed line indicates that the FD A –> C may not be explicitly given but it is always present because it can be derived using the inference axioms.

Rule to resolve transitive dependence

The above rule, simply states that if B depends on A and C depends on B, then it can be decomposed to (A, B) and (B, C).

Conversion of STUDENT_SYSTEM_CHARGE (Rollno, Name, System_Used,Hourly_Rate) 
to Third Normal Form:

The relation STUDENT_SYSTEM_CHARGE is not in 3NF because there is a transitive dependency of a non prime attribute on the primary key of the relation. In this case, the Non prime attribute Hourly_Rate is transitively dependent on the primary key Rollno through the functional dependency System_Used –> Hour1y_Rate. Notice that all other conditions required by the definition are met by this set of FDs. In particular, we have that Rollno a System_Used and System_Used a Hourly_Rate.

To transform this relation into a 3NF relation, it is necessary to remove any transitive dependency of a nonprime attribute on the key. According to the figure it is necessary to create two new relations.

The scheme of the first relation is:

STUDENT_SYSTEM (Rollno, Name, System_Used).

The scheme of the second relation is:

CHARGES (System_Used, Hourly_Rate).

Observe that in the second relation, the System _Used attribute has been made the primary key of the relation as required by the diagram.

Using the second definition of 3NF, we can determine that the STUDENT_SYSTEM_CHARGE relation is not in 3NF by noticing that System_Usedà Hourly_Rate, here both attributes are nonprime. To transform this relation to 3NF we use the same general procedure of above figure.

Student_SystemRemoval of anomalies of Second Normal form

Insertion anomalies

In the revised structure of STUDENT_SYSTEM and CHARGES, it is possible to insert in advance the rate to be charged from the students for a particular system (in CHARGES database). It means that we can insert that hourly rate of laptop in CHARGES table independent from whether it is used by any student or not.

Update anomalies

If the Hourly_Rate for a particular system changes, we need only to change a single record in CHARGES database for that particular system.

Delete anomalies

We delete the tuple of a student who happens to be the only student left which is working on a particular system without losing the information about the rate that we charge for that particular system (We can get is information from CHARGES database).

Data Anomalies in 3NF Relations

The 3NF helped us to get rid of the data anomalies caused either by transitive dependencies on the PK or by dependencies of a nonprime attribute on another nonprime attribute. However, relations in 3NF are still susceptible to data anomalies particularly when the relations have two overlapping candidate keys or when a nonprime attribute functionally determines a prime attribute. The following example will illustrate this.

Example

Consider the Manufacturer relation shown below where each manufacturer has a unique ID and name. Manufacturers produce items (identified by their unique item numbers) in the amounts indicated. Manufacturers may produce more than one item and different manufacturers may produce the same items.

Manufacturer ( Id_No, Name, Item No, Quantity)

Manufacturer

This Manufacturer relation has two candidate keys: (ID, Item_No) and (Name, Item_No) that overlap on the attribute Item_No. The relation is in 3NF because there is only one nonprime attribute and therefore it is impossible that this attribute can determine another nonprime attribute.

The relation Manufacturer is susceptible to update anomalies. Consider for example the case in which one of the manufacturers changes its name. If the value of this attribute is not changed in all of the corresponding Tuples there is the possibility of having an inconsistent database.

We can take another case of Supplier-Part table having following attributes:

(Sno, Sname, Pno, Qty)

 

Here, let us suppose that Sname (supplier name) is unique for each Sno (supplier number) as shown below:Supplier

This Supplier-Part relation has two candidate keys: (S’10, Pno) and (Sname, Pno) that overlap on the attribute Pno. The relation is in 3NF because there is only one non prime attribute and therefore it is impossible that this attribute can determine another non prime attribute.

The relation is susceptible to update anomalies. Consider for example, the case in which one of the supplier changes its name, then we have to make multiple changes which is equal to the number part supplied by that particular supplier. This relation is in second and third normal form because it has only one non-key attribute Qty which is FFD on Primary key. Sname cannot be called as non key attribute because it can participate in the primary key in case of (Sname, Pno) primary key. This relation is normalized with the help of Boyce-Codd normal form.

You’ll also like:

  1. First Normal Form (1NF)
  2. Fifth Normal Form(5NF)
  3. Second Normal Form (2NF)
  4. Fourth Normal Form (4NF)
  5. Boyce-Codd Normal Form (BCNF)
Next →
← Prev
Like/Subscribe us for latest updates     

About Dinesh Thakur
Dinesh ThakurDinesh Thakur holds an B.C.A, MCDBA, MCSD certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps.

Dinesh Thakur is a Freelance Writer who helps different clients from all over the globe. Dinesh has written over 500+ blogs, 30+ eBooks, and 10000+ Posts for all types of clients.


For any type of query or something that you think is missing, please feel free to Contact us.


Primary Sidebar

DBMS

Database Management System

    • DBMS - Home
    • DBMS - Definition
    • DBMS - What is
    • DBMS - Entity Sets
    • DBMS - Components
    • DBMS - Languages
    • DBMS - Normalization
    • DBMS - Data Models
    • DBMS - Processing System
    • DBMS - Advantages
    • DBMS - ER-Model
    • DBMS - Functional Dependence
    • DBMS - Relational Model
    • DBMS - Architecture
    • DBMS - Network Model
    • DBMS - Approach
    • DBMS - Data Independence
    • DBMS - Relational Schema
    • DBMS - Instance
    • DBMS - Functions and Service
    • DBMS - Server
    • DBMS - DBA
    • DBMS - Instance & Schemas
    • DBMS - System Type
    • DBMS - DDL, DML and DCL
    • DBMS - Users
    • DBMS - Model
    • DBMS - System Structure
    • DBMS - Role of DBA
    • DBMS - Metadata
    • DBMS - ER-Diagram
    • DBMS - E-R Model Problems
    • DBMS - DBMS Vs.RDBMS
    • DBMS - Basic Construction of E-R
    • DBMS - E-R Notation
    • DBMS - Database View
    • DBMS - Concurrency Control
    • DBMS - Schema
    • DBMS - Procedure for Access
    • DBMS - Object
    • DBMS - dBase
    • DBMS - Relational Algebra
    • DBMS - Deadlock
    • DBMS - Relational Database
    • DBMS - Query
    • DBMS - Schema

DBMS Normal Forms

    • Database - CODD’S Rules
    • Database - 1NF
    • Database - 2NF
    • Database - 3NF
    • Database - 4NF
    • Database - 5NF
    • Database - BCNF

Advance Database

    • Database - File Organization
    • Database - Type Lock
    • Database - Transaction
    • Database - Key Type
    • Database - Relational Algebra
    • Database - Components
    • Database - Deadlock Detect
    • Database - Design Methodology
    • Database - Relational Operators
    • Database - Relational Calculus
    • Database - Lock Granularity
    • Database - Deadlocks Handling
    • Database - Concurrent Control
    • Database - Denormalization
    • Database - Starvation
    • Database - OODB
    • Database - Data Warehouse
    • Database - Fragmentation
    • Database - Data Replication
    • Database - Distributed
    • Database - Transparences
    • Database - ORDBMSS
    • Database - Data Mining
    • Database - Security
    • Database - DBTG
    • Database - OLAP
    • Database - Integrity
    • Database - Data Encryption
    • Database - Recover
    • Database - Data Protection

Some Other Advance Articls

  • Adv of Distributed DBMS
  • Homogeneous and Heterogeneous
  • Causes for Database Failure
  • DBMS Architecture
  • Features for Any DBMS
  • OLTP Systems Vs Data Warehousing
  • Data Warehousing Architecture

Other Links

  • DBMS - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW