Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

1-NF form in DBMS

1-NF Form in DBMS

 

In this article, 1-NF Form in DBMS.

Normalization is a process of breaking a table into a much better table so that it is free from all the problems due to insertion update and deletion.

 

Learn more about Normalization here on this page.

1-NF form in DBMS

First Normal Form(1NF)

  • Definition: A table is said to be in First Normal Form if it is free from multivalued or composite attributes i.e each attribute should be atomic
  • A multivalued attribute is nothing but it contains more than one value in a single cell

Problem Table:

Consider a table where a student can have multiple phone numbers

STUDENT

Roll noNamePhone
66TrishaankP1
73PrashantP2, P3
79SanjayP4
82SrinivasP5

 

From the above figure, we can see that a cell is containing two values(two phone numbers) which breaks our rule

This problem can be solved in three approaches

 

Approach 1:

Eliminate the multivalued attribute by introducing a composite keyi.e roll number, phone number combination would act as a primary key

Problem Table

Roll noNamePhone
66TrishaankP1
73PrashantP2 ,P3
79SanjayP4
82SrinivasP5

Normalized to 1NF

Roll noNamePhone
66TrishaankP1
73PrashantP2
73PrashantP3
79SanjayP4
82SrinivasP5

Drawback:

This approach causes serious drawback  of update anomaly due to redundancy in the table (Prashant data stored redundantly)

Approach 2:

Divide the table into two parts such that all the multivalued attributes in one table at single-valued attributes in another table and add primary key attribute of the original table to each newly formed tables

Student Phone

Roll noPhone
66P1
73P2
73P3
79P4
82P5

Student

Roll noName
66Trishaank
73Prashant
79Sanjay
82Srinivas

In this example, multivalued attributes phone numbers and primary key attribute roll number will from one table and all the remaining single-valued attributes name and primary key attribute roll number will from another table

Approach 3:

Make each and every attribute as atomic i.e introduce n separate columns for n multivalues

Problem Table

Roll noNamePhone
66TrishaankP1
73PrashantP2,  P3
79SanjayP4
82SrinivasP5

Normalized to 1NF

Roll noNamePhone1Phone2Phone3
66TrishaankP1———–———–
73PrashantP2P3———–
79SanjayP4———–———–
82SrinivasP5———–———–

Drawbacks:

It’s it not necessary that each and every student would have multiple phone numbers, as a result, empty  cells have to be maintained which results in memory wastage