It is a level of normalization in DBMS. A relation is said to be in 1 normal form in DBMS (or 1NF) when it consists of an atomic value. In simpler words, 1NF states that a table’s attribute would not be able to hold various values- it will only be able to hold an attribute of a single value.
When a relation consists of a multi-valued or composite attribute, it would be violating the 1NF, since the 1NF disallows any composite attribute, multi-valued attribute, or even their combinations.
In this article, we will take a look at the First Normal Form in DBMS and its uses according to the GATE Syllabus for CSE (Computer Science Engineering). Read ahead to learn more.
Table of Contents
- What Is The First Normal Form In DBMS?
- Rules Followed In 1st Normal Form In DBMS
- Example #1
- Example #2
- Practice Problems On First Normal Form In DBMS
- FAQs
What is the First Normal Form in DBMS?
A database is said to be in 1NF if it falls under these conditions:
- It only consists of atomic values
- No repeating groups are present
Here, an atomic value refers to that value that can’t be divided in a relational database.
Rules Followed in 1st Normal Form in DBMS
There are a few rules that the first normal form must follow in DBMS. These are:
#1. The Attributes must be Single Valued
Every column in your table must be single-valued. It means that no columns should have multiple values in a single cell. In case we don’t have single values in a cell, we won’t be able to call it 1NF.
For instance, if we take a look at a table that consists of data regarding a single novel and its writers, and it has the following columns: [Book ID], [Writer 1], [Writer 2], and [Writer 3]. In this case, [Writer 1], [Writer 2], and [Writer 3] repeat the same attribute. They do not refer to different Book 1Ds. Thus, this table would not be in 1NF.
#2. The Domain of attributes must not change
Every value stored in every table column must be of the same type/ kind. Random values should not make up the table.
For instance, if a table consists of a column named DOB that saves the date of birth of various people, we cannot use this column to save the names of these people. We need a separate column for that. Every column must hold separate sets of attributes in a DBMS table.
#3. Every Column/ Attribute must have a Unique Name
A 1NF table expects that every column present in a table consists of a unique name of its own. This way, it becomes feasible to avoid any confusion while the system is retrieving, editing, or adding data, or performing any other operations on the table. In case multiple columns have a similar name, then the system will be confused in the end.
#4. The order of Data does not matter
The order in which we store the data in a table does not matter in 1NF. It is a simple way of storing info- no shenanigans involved.
Example #1
Let us take a look at an example in the form of a table. Here, we can divide the values available in the first row of the [Hues] column into pink and black. Thus, the [TABLE_ITEMS] is not present in 1NF.
Item No. | Hues | Cost |
1 | pink, black | 15.99 |
2 | red | 23.99 |
3 | black | 17.50 |
4 | red, grey | 9.99 |
5 | brown | 29.99 |
The table here isn’t in the first normal form, since the column [Hues] can consist of multiple values in it. For instance, the first row consists of pink and black, and the fourth row consists of red and grey.
How do we bring this table, which is in an unnormalized form, into the normalized form? We will split this table into two separate ones. As a result, we will have to generate the following tables:
Item No. | Hues |
1 | pink |
1 | black |
2 | red |
3 | black |
4 | red |
4 | grey |
5 | brown |
Item No. | Cost |
1 | 15.99 |
2 | 23.99 |
3 | 17.50 |
4 | 9.99 |
5 | 29.99 |
Here, the first normal form is finally satisfied with both of these tables. It is because all the columns of each of these hold just single values, and that’s what we want from 1NF.
Remember that a repeating group refers to a table that consists of two or more than two columns that are related to each other closely.
Example #2
Look at this sample data in a table:
Serial_No. | Titles | Courses |
11 | Xkon | CN, OS |
12 | Ykon | Java |
13 | Zkon | C++, C |
Here, you can see there are multiple values in similar columns. We can resolve it as follows:
Serial_No. | Titles | Courses |
11 | Xkon | CN |
11 | Xkon | OS |
12 | Ykon | Java |
13 | Zkon | C++ |
13 | Zkon | C |
This way, although a few values are getting repeated, we can still see that there is just one value in every column.
Practice Problems On First Normal Form in DBMS
1. Decompose the following table into 1NF:
Student_ID | Student_Name | Student_Hobbies | Student_State |
IX1 | Reema | Dancing
Painting |
Maharashtra |
IX2 | Rekha | Cooking
Calligraphy |
Rajasthan |
IX3 | Jaya | Skating | Kerala |
IX4 | Sushma | Painting
Skating |
Chhattisgarh |
IX5 | Tithi | Poetry
Fencing |
Haryana |
Answer –
Student_ID | Student_Name | Student_Hobbies | Student_State |
IX1 | Reema | Dancing | Maharashtra |
IX1 | Reema | Painting | Maharashtra |
IX2 | Rekha | Cooking | Rajasthan |
IX2 | Rekha | Calligraphy | Rajasthan |
IX3 | Jaya | Skating | Kerala |
IX4 | Sushma | Painting | Chhattisgarh |
IX4 | Sushma | Skating | Chhattisgarh |
IX5 | Tithi | Poetry | Haryana |
IX5 | Tithi | Fencing | Haryana |
2. Decompose the following table into 1NF:
Names | Watched_Series |
Stuart | Friends
How I Met Your Mother |
Howard | The Big Bang Theory
How I Met Your Mother |
Raj | The Office
Orange Is The New Black |
Penny | Dark
Brooklyn Nine-Nine South Park |
Bernadette | Stranger Things
Rick and Morty |
Answer –
Names | Watched_Series |
Stuart | Friends |
Stuart | How I Met Your Mother |
Howard | The Big Bang Theory |
Howard | How I Met Your Mother |
Raj | The Office |
Raj | Orange Is The New Black |
Penny | Dark |
Penny | Brooklyn Nine-Nine |
Penny | South Park |
Bernadette | Stranger Things |
Bernadette | Rick and Morty |
FAQs
What is the 1st normal form in DBMS?
A database is said to be in 1NF if it falls under these conditions:
- It only consists of atomic values
- No repeating groups are present
Here, an atomic value refers to that value that can’t be divided in a relational database.
Why is Data redundancy higher in 1st normal form?
Data redundancy increases a lot with 1 normal form in DBMS, since it has multiple columns with the very same data in a lot of rows. Although every row would be unique, all the cells are not unique- thus making a 1NF table redundant.
How do you convert data to the first normal form?
There are a few rules that the first normal form must follow in DBMS. These are:
- The Attributes must be Single Valued
- The Domain of attributes must not change
- Every Column/ Attribute must have a Unique Name
- The order of Data does not matter
Why is 1st normal form important?
The most important thing that we get with 1NF is that it will eliminate the repeating of groups in a table. Now, this may cause redundancy, but accessing data becomes easier for a system.
Thus, instead of creating multiple columns that have the same data in the record (or 0NF), we can remove the repeated info set and create a separate relation/ row in the same table or a different table.
Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus for CSE (Computer Science Engineering), GATE CSE Notes, GATE CSE Question Paper, and more.
Also Explore,
Comments