DEV Community

Pranav Bakare
Pranav Bakare

Posted on

Normalization | 1 NF

First Normal Form (1NF)

It is the most basic level of database normalization. A table is in 1NF if it meets the following criteria:

  • Atomic Values: All the columns should contain atomic (indivisible) values, meaning each cell in the table should hold a single value. No multiple values (like a list) in a single cell.
  • No Repeating Groups: There should be no repeating groups or arrays in the table. Each piece of data should be stored in a separate row and column.

Example of a Table Not in 1NF

Image description

OrderID CustomerName    PizzaSize   Toppings
001 Alice   Medium  Pepperoni, Mushrooms
002 Bob Large   Sausage, Olives
003 Charlie Small   Pepperoni
Enter fullscreen mode Exit fullscreen mode

Issues:

The Toppings column contains multiple values (e.g., "Pepperoni, Mushrooms"), which violates 1NF because each cell should have only a single, atomic value.

Transforming to 1NF
To bring this table into 1NF, we need to ensure that each cell contains a single value:

Image description


Summary

A table is in 1NF when:

  • Each column contains atomic, indivisible values.
  • There are no repeating groups or arrays within rows.
  • 1NF helps ensure data consistency by breaking down data into the smallest meaningful units, making it easier to search, sort, and manage.

Top comments (0)