This content originally appeared on DEV Community and was authored by Pranav Bakare
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
OrderID CustomerName PizzaSize Toppings
001 Alice Medium Pepperoni, Mushrooms
002 Bob Large Sausage, Olives
003 Charlie Small Pepperoni
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:
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.
This content originally appeared on DEV Community and was authored by Pranav Bakare
Pranav Bakare | Sciencx (2024-10-23T15:08:30+00:00) Normalization | 1 NF. Retrieved from https://www.scien.cx/2024/10/23/normalization-1-nf/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.