Trusted answers to developer questions

What is the first normal form (1NF)?

Get Started With Machine Learning

Learn the fundamentals of Machine Learning with this free course. Future-proof your career by adding ML skills to your toolkit — or prepare to land a job in AI or Data Science.

Normal forms

Normalization is the process of reducing redundancy from a set of relations. In database tables, we can use normal forms to carry out this process. The four main normal forms are:

As the figure below shows, these normal forms build upon one another progressively. In this shot, we will focus on the first normal form.

First normal form (1NF)

For a table to be in first normal form, it needs to satisfy the following conditions:

  • It should only have atomicmeans it cannot hold multiple values attributes/columns.
  • All values in a column should belong to the same domain.
  • All column names should be unique.
  • The order of data storage should not matter.

Now, let’s look at a concrete example of a table that is currently not in first normal form:

ID Person Number
1 Sultan 4324521, 5254326
2 Aasia 4924575
3 Farhan 9875325
4 Vafa 2468967, 7533678
5 Zakariya 4675379, 4646388

In the above example, the values in the Numbers column are not atomic. To decompose the table to the first normal form, we must make these values atomic. We can do this by allocating separate rows to each number, like this:

ID Person Number
1 Sultan 4324521
1 Sultan 5254326
2 Aasia 4924575
3 Farhan 9875325
4 Vafa 2468967
4 Vafa 7533678
5 Zakariya 4675379
5 Zakariya 4646388

RELATED TAGS

general

CONTRIBUTOR

Anusheh Zohair Mustafeez
Did you find this helpful?