Skip to content
  • SiteMap
  • Our Services
  • Frequently Asked Questions (FAQ)
  • Support
  • About Us

UpdateGadh

Update Your Skills.

  • Home
  • Projects
    •  Blockchain projects
    • Python Project
    • Data Science
    •  Ai projects
    • Machine Learning
    • PHP Project
    • React Projects
    • Java Project
    • SpringBoot
    • JSP Projects
    • Java Script Projects
    • Code Snippet
    • Free Projects
  • Tutorials
    • Ai
    • Machine Learning
    • Advance Python
    • Advance SQL
    • DBMS Tutorial
    • Data Analyst
    • Deep Learning Tutorial
    • Data Science
    • Nodejs Tutorial
  • Blog
  • Contact us
  • Toggle search form
Second Normal Form (2NF)

Second Normal Form (2NF)

Posted on July 26, 2025July 26, 2025 By Rishabh saini No Comments on Second Normal Form (2NF)

Second Normal Form (2NF)

Normalisation is a crucial step in relational database design that ensures data consistency and gets rid of redundancy. The Second Normal Form (2NF) plays an important role in this process by building upon the First Normal Form (1NF). In this blog, we’ll understand what 2NF is, explore its principles with real-life examples, and see why even 2NF isn’t always enough.

Machine Learning Tutorial:–Click Here
Data Science Tutorial:-Click Here
Complete Advance AI topics:- CLICK HERE
Deep Learning Tutorial:- Click Here

What is Second Normal Form (2NF)?

Second Normal Form is used for a relationship if:

  1. It is already in First Normal Form (1NF), and
  2. All non-key attributes are fully functionally dependent on the entire primary key—not just a part of it.

In simple terms, this means that no non-key attribute should be dependent on a part (subset) of a composite primary key.The table needs to be broken down if there are any such partial dependencies.

Example: Teacher and Subject Data

Assume that a school keeps records of its instructors and the courses they instruct. This is how the data may initially appear:

TEACHER Table

TEACHER_IDSUBJECTTEACHER_AGE
25Chemistry30
25Biology30
47English35
83Math38
83Computer38

In the above table, the combination of TEACHER_ID and SUBJECT acts as a composite key. However, TEACHER_AGE depends only on TEACHER_ID, not on the full composite key. This is a partial dependency, which violates 2NF.

Converting to 2NF

To resolve this, we decompose the table into two separate relations:

TEACHER_DETAIL Table

TEACHER_IDTEACHER_AGE
2530
4735
8338

TEACHER_SUBJECT Table

TEACHER_IDSUBJECT
25Chemistry
25Biology
47English
83Math
83Computer

Now, both tables are in 2NF as all non-key attributes are fully dependent on their respective primary keys.

Anomalies in 2NF

Even after achieving 2NF, a relation can still suffer from insertion, deletion, and update anomalies. Let’s explore these with another example.

Consider the STUDENT Table:

Stu_IdStu_NameTeach_IdTeach_NameTeach_Qual
2523Anurag201MohanMCA
3712Raju202RaviM.Tech
4906Raman203MahimaPh.D
2716Jyoti204AnjaliMCA
1768Meetali205SoniaM.Tech

Here, Stu_Id is the primary key. While the table is technically in 2NF, it still has several flaws.

Insertion Anomaly

Assume that Mayank, a new instructor with Teach_Id = 206 and MCA certification, is to be added. However, the Stu_Id would be NULL because Mayank hasn’t been given any students yet, which is against the entity integrity constraint.

Stu_IdStu_NameTeach_IdTeach_NameTeach_Qual
NULLNULL206MayankMCA

This insertion is not possible, revealing a flaw in the current design.

Deletion Anomaly

Imagine student Stu_Id = 1768 (Meetali) leaves the college. Deleting her record would also delete information about her teacher Sonia (Teach_Id = 205)—even if Sonia is still part of the faculty. Important data about teachers is lost unintentionally.

Update Anomaly

Suppose the qualification of teacher Anjali (Teach_Id = 204) is updated from MCA to Ph.D. If this information appears in multiple rows (for different students), we must update it everywhere. A single missed update leads to inconsistent data across the table.

Why 2NF Isn’t Enough

While 2NF reduces redundancy and solves partial dependencies, it does not address all forms of anomalies. Insertion, deletion, and update anomalies can still exist. Therefore, 2NF is not the final stage in logical database design. To eliminate these issues, we must further refine the schema into Third Normal Form (3NF).

Complete Python Course with Advance topics:-Click Here
SQL Tutorial :-Click Here

Download New Real Time Projects :-Click here

Final Thoughts

Second Normal Form is a crucial milestone in database normalization, but it doesn’t guarantee a fully optimized schema. As we saw, certain data anomalies still persist even after reaching 2NF. The next step—Third Normal Form—further strengthens data integrity by removing transitive dependencies.

Stay tuned for our upcoming post on 3NF, where we’ll guide you through its concept, benefits, and real-world application.


third normal form
second normal form example
first normal form
second normal form in dbms
third normal form in dbms
partial dependency in 2nf
1nf, 2nf, 3nf with example
third normal form example
second normal form 2nf in dbms
second normal form 2nf example
second normal form 2nf geeksforgeeks

    Post Views: 354
    DBMS Tutorial Tags:2nf normal form, 2nf second normal form, database second normal form, dbms - second normal form (2nf), in second normal form, second normal form, second normal form (2nf), second normal form (2nf) - database normalization, second normal form 2nf, second normal form database, second normal form dbms, second normal form example, second normal form in dbms, second normal form sql, second normal form-2nf, table in second normal form, tables in second normal form (2nf), the second normal form - 2nf

    Post navigation

    Previous Post: What is a Neural Radiance Field (NeRF)
    Next Post: Best Online Catering Reservation System using PHP MySQL

    More Related Articles

    Difference Between DBMS and RDBMS Difference Between DBMS and RDBMS DBMS Tutorial
    Schedule in DBMS Schedule in DBMS DBMS Tutorial
    Inclusion Dependency Inclusion Dependency DBMS Tutorial

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    You may also like

    1. What is a Database? Definition, Types, Examples
    2. Difference Between DBMS and RDBMS
    3. ER Design Issues
    4. DBMS Specialization
    5. Relational Model in DBMS
    6. Fifth Normal Form (5NF) in DBMS

    Most Viewed Posts

    1. Top Large Language Models in 2025
    2. Online Shopping System using PHP, MySQL with Free Source Code
    3. login form in php and mysql , Step-by-Step with Free Source Code
    4. Flipkart Clone using PHP And MYSQL Free Source Code
    5. News Portal Project in PHP and MySql Free Source Code
    6. User Login & Registration System Using PHP and MySQL Free Code
    7. Top 10 Final Year Project Ideas in Python
    8. Online Bike Rental Management System Using PHP and MySQL
    9. E learning Website in php with Free source code
    10. E-Commerce Website Project in Java Servlets (JSP)
    • AI
    • ASP.NET
    • Blockchain
    • ChatCPT
    • code Snippets
    • Collage Projects
    • Data Science Project
    • Data Science Tutorial
    • DBMS Tutorial
    • Deep Learning Tutorial
    • Final Year Projects
    • Free Projects
    • How to
    • html
    • Interview Question
    • Java Notes
    • Java Project
    • Java Script Notes
    • JAVASCRIPT
    • Javascript Project
    • JSP JAVA(J2EE)
    • Machine Learning Project
    • Machine Learning Tutorial
    • MySQL Tutorial
    • Node.js Tutorial
    • PHP Project
    • Portfolio
    • Python
    • Python Interview Question
    • Python Projects
    • PythonFreeProject
    • React Free Project
    • React Projects
    • Spring boot
    • SQL Tutorial
    • TOP 10
    • Uncategorized
    • Online Examination System in PHP with Source Code
    • AI Chatbot for College and Hospital
    • Job Portal Web Application in PHP MySQL
    • Online Tutorial Portal Site in PHP MySQL — Full Project with Source Code
    • Online Job Portal System in JSP Servlet MySQL

    Most Viewed Posts

    • Top Large Language Models in 2025 (8,615)
    • Online Shopping System using PHP, MySQL with Free Source Code (5,218)
    • login form in php and mysql , Step-by-Step with Free Source Code (4,870)

    Copyright © 2026 UpdateGadh.

    Powered by PressBook Green WordPress theme