Table of contents
1.
What is First Normal Form?
2.
Rules of 1st NF in DBMS
3.
Example of 1NF in DBMS
3.1.
Example 1
3.2.
Example 2
4.
Fixing the Table for 1NF
5.
Frequently Asked Questions
5.1.
What are the anomalies in 1NF in DBMS?
5.2.
Why is 1NF important?
5.3.
What is the significance of 1NF in database design?
5.4.
How do you convert data to the first normal form?
5.5.
Does 1NF have a primary key?
6.
Conclusion
Last Updated: Jul 16, 2024
Easy

First Normal Form (1NF) in DBMS

Author Gaurish Anand
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

1 NF in DBMS is a part of normalization. Normalization is used to remove the redundancy and inconsistent dependence in the database. Anomalies in insertion, deletion, and update can be caused by relation redundancy. 

First Normal Form (1NF) in DBMS

To normalize a dataset, we break down this large dataset into different smaller datasets depending upon the relationships among tables. 

There are various types of normal forms. Some of them are 

  1. First Normal Form (1NF)
  2. Second Normal Form (2NF)
  3. Third Normal Form (3NF)
  4. Boyce Codd Normal Form (BCNF

Here, we will be discussing the first normal form.

What is First Normal Form?

A relation (table) in a DBMS is in First Normal Form (1NF) if all its attributes contain atomic values (single, indivisible data) and there are no repeating groups within the table. Additionally, each attribute must have a unique name.

Rules of 1st NF in DBMS

For a table to be in 1NF, it should follow these rules: 

  1. The table only contains composite or single-valued attributes.
  2. Every Attribute/Column should have a different name.
  3. There should be no difference in which order data is stored.
  4. The domain of the attribute should not change.

Example of 1NF in DBMS

Because of the multi-valued attribute STUD_PHONE, the relation STUDENT is not in 1NF

Example 1

STUDENT table: 

STUD_ID STUD_NAME STUD_PHONE STUD_CITY
1 Harsh

727282638X,

906473823X

Delhi
Shivam 981161425X Banglore
Pranav

739037238X,

858983030X

Mumbai

The above table decomposed into 1NF will like this: 

STUD_ID STUD_NAME STUD_PHONE STUD_CITY
1 Harsh 727282638X Delhi
1 Harsh 906473823X Delhi
Shivam 981161425X Banglore
Pranav 739037238X Mumbai
Pranav 858983030X Mumbai

Example 2

Here's an example of a table violating 1NF:

Customer ID Customer Name Courses Enrolled
1 Alice Math, Science, English
2 Bob Programming, History

drive_spreadsheetExport to Sheets

This table violates 1NF because of the "Courses Enrolled" column. It contains multiple values (course names) separated by commas, which breaks the rule of atomic values in a cell.

Fixing the Table for 1NF

Here's how to fix the table to comply with 1NF:

Create a Separate Table for Courses:

We'll create a new table named "Enrollments" to link customers with their enrolled courses.

Enrollments Table:

Enrollment ID (Primary Key) Customer ID (Foreign Key) Course Name
1 1 Math
2 1 Science
3 1 English
4 2 Programming
5 2 History

Original Customer Table (Modified):

Customer ID (Primary Key) Customer Name
1 Alice
2 Bob

Frequently Asked Questions

What are the anomalies in 1NF in DBMS?

1NF itself doesn't have anomalies (data inconsistencies). However, tables that violate 1NF principles can lead to insertion, deletion, and update anomalies during data manipulation.

Why is 1NF important?

1NF is the foundation for a well-structured database. It ensures data integrity by eliminating redundancy and promoting efficient data manipulation, retrieval, and modification.

What is the significance of 1NF in database design?

1NF serves as the first step in database normalization. By enforcing atomic values and eliminating repeating groups, it creates a solid base for further normalization processes that optimize database design for efficiency and accuracy.

How do you convert data to the first normal form?

Identify and eliminate repeating groups within a table. If data needs to be repeated for certain rows, create separate tables and link them with appropriate relationships. Additionally, ensure each cell contains a single, indivisible value.

Does 1NF have a primary key?

1NF doesn't mandate a primary key. However, establishing a primary key for each table is good practice and often implemented during database normalization processes beyond 1NF.

Conclusion

We learned about the First Normal Form (1NF) in DBMS in this article. First Normal Form (1NF) serves as the essential building block for a well-organized and efficient database. By enforcing atomic values and eliminating repeating groups, 1NF promotes data integrity and simplifies data manipulation.

Since SQL-related questions are frequently asked in interviews, we recommend you practice Top 100 SQL problems on Code360. 

Also, check out - Anomalies In DBMS.

Are you planning to ace the interviews of reputed product-based companies like Amazon, Google, Microsoft, and more? Attempt our Online Mock Test Series on Code360 now!

Live masterclass