1NF – What is 1NF example?

A relation is in 1NF(What is 1nf example) or first normal form if every tuple has exactly one value for each attribute.

In other words, we can say that every column should have a unique or atomic value related to the corresponding attribute.|What is 1nf example|

Within this blog(First Normal Form), we are going to explore What is 1nf example. What are 1nf 2nf and 3nf? Why is this table not in 1nf? How do you write 1nf?…

… 1NF example, 3NF example, BCNF vs 3NF, BCNF example, Step by step normalization example The need for normalization in DBMS|What is 1nf example|

A database is in its first normal form if every relation included in a database is in 1NF(What is 1nf example).

The first normal form deals only with the basic structure of the relationship and does not resolve the problems of redundant information and any other anomalies|What is 1nf example|

Let’s understand this with the help of an example of an organization where we have information about employee_id, employee_name, phone number, and their salary|What is 1nf example|

Table 1. Non-Domain Form

emp_idemp_nameemp_phone_nosalary
101Priya94243410,000
102Ashish999348
999347
7,000
103Mayank99932815,000
104Piyush989312
989313
20,000

Here we can see that an employee can have more than one phone number so, each tuple of the above table does not have only one value for each attribute.

To convert it into a 1NF(First Normal Form) we use the following steps-

  • For each repeating field, the value creates a new tuple.
  • Insert the repeating field value in that field of the new tuple
  • duplicate the values of all other attributes of the original tuple and put them in a new tuple.

In our example, we have a phone_no field of Ashish and Piyush that have repeating values.

So we have to create new tuples only for these two employees. See the changes in the below table.

Table 1.1 Normalized Form

emp_idemp_nameemp_phoneemp_salary
101Priya 942434 10,000
102Ashish 999348
7,000
102Ashish 999347 7,000
103Mayank 999328 15,000
104Piyush 989312
20,000
104Piyush 989313 20,000
(First Normal Form)

Problems and anomalies in 1NF(first normal form):

Insert:

We can not insert the information of an employee who does not have a phone no.

Delete:

If we delete a whole first tuple of a particular employee then we delete not only the phone no of an employee but also lose other information such as salary and employee_id.

For example: if we delete a tuple of employee Priya whose phone is disconnected then we also lose other information about Priya such as her salary.

Update:

In this form of the relation 1NF, we have the same information repeated many times.

If we want to update some information, first we have to search for all the tuples containing that information and then update all the tuples.

for example: if the salary of Piyush gets incremented to 25000 and we want this information in our relation, for this first of all we have to search all the tuples having employee name ‘Piyush’ and then update the salary to 25000 of each tuple.

But if we forget the update of any of the tuples named Piyush then it will result in inconsistency. to avoid this we go for 2NF.

Check out some amazing blog posts related to Normalization:

What is Normalization and why is it needed?

What is 2NF in DBMS?

What is 3NF in DBMS?

What is BCNF in DBMS?

You can also go through a few more amazing blog links related to DBMS below:

Composite key: Composite key vs Super key…
What is the null value Problem in DBMS…
What is the super key in DBMS…
What is a candidate key in DBMS…
What is Key in DBMS…
BCNF – Boyce Codd Normal Form…
3NF – Third normal form…
2NF – Second Normal Form…
What is1NF(First Normal Form)…
What is normalization with an example…
What do you mean by distributed DBMS and what are its types…
What is DBMS ARCHITECTURE…
DBMS vs RDBMS: What is the main difference between DBMS and RDBMS…
What are the functions of DBA in DBMS…
Integrity constraints in DBMS…

Quick Q&A:

What is a 1NF example?

Let’s assume, you have an employee table and in that employee table you have a field emp_mobile_number.

In today’s time easily there could be a case when one employee has two mobile numbers or would be using two mobile numbers.

But here we talk about one specific employee Mohan.

assume that, Mohan is using two mobile numbers and his both mobile number is inserted into the employee table mobile number field.

Now, in this scenario, we have multivalued column values as mobile numbers or two mobile numbers for Mohan in one column.

So this table is not in 1 normal form.

If we want to make this table in 1NF then we will have to remove one mobile number of Mohan and keep only one single number in that column.

This was just to make you understand the concept of 1NF.

Overall, IF a relation is in 1NF then each column should have a unique value inside it.

What is 2NF in DBMS?

There have to be two most important conditions to be satisfied for having a relation in 2NF

The relation must be in 1NF- All the table attributes should have a unique column value.

No non-prime attributes should be functionally dependent on the candidate key subset – all the non-prime attributes must be dependent on the primary key of the relation.

Non-prime attributes are those attributes that are not the part of table candidate key.

Why is 1NF used?

The first normal form is very important for having a relation or table with unique data.

It is easy to insert, update, and delete the table data if each column has a unique value or record.

What is 3NF in DBMS?

A relation is said to be in 3NF If it satisfies the following conditions given below:

A relation must be in 2 NF.

Non-prime attributes should not have any transitive dependency-

To understand this let’s assume we have a functional dependency set(emp_code->emp_age, employee_state, emp_country, emp_sal)

Here our candidate key would be emp_code.

Now in this relation, we see that emp_code->emp_state and emp_state->emp_country are true. Here emp_country is transitively dependent on emp_code.

So this relation would be considered in 3NF.

If you want to make it in 3NF then you would have to normalize this relation such as given below:

employee(emp_code, emp_age, emp_sal, emp_state)
emp_sate_country(emp_state, emp_country)

Now this relation would be in 3NF.

Conclusion:

Even after converting our data table into 1NF(First Normal Form) where we have a unique or single tuple value for a particular attribute we have redundancy and anomalies problems with us. So to remove the problems of 1NF, we have to go for 2NF. So in our next blog post, we will update you with the same|What is 1nf example|

Using this blog post(First Normal Form) we have gone through Within this blog, we are going to explore The 1nf example. What are 1nf 2nf and 3nf? Why is this table not in 1nf? How do you write 1nf? 1NF example, 3NF example, BCNF vs 3NF, BCNF example, Step by step normalization example, The need for normalization in DBMS|What is 1nf example|

Hope! you would have liked this blog(What is 1nf example). Please feel free to let us know if you have any doubts about this post. You can also write to us at a5theorys@gmail.com. Have a good time!

Anurag

I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.