SQL Topics
First Normal Form 1NF
title: First Normal Form 1NF
In the previous lesson, you learned about Database Normalization and how normalization helps reduce redundancy, eliminate anomalies, and improve database design.
Normalization is performed in stages known as Normal Forms.
The first and most fundamental stage is:
First Normal Form (1NF)Every normalized database must first satisfy the rules of 1NF before moving to higher normal forms such as:
2NF
3NF
BCNFFirst Normal Form focuses on ensuring that every column contains atomic values and that repeating groups are eliminated.
Although 1NF appears simple, it forms the foundation of all relational database design.
What is First Normal Form (1NF)?
A table is said to be in First Normal Form (1NF) if:
Each Column Contains Atomic Values
No Repeating Groups Exist
Each Row Is Unique
Each Column Stores A Single ValueThe word:
Atomicmeans:
Indivisible
Single ValueEach cell should contain only one value.
Why is 1NF Important?
Relational databases are designed to work with:
Rows
Columns
Single ValuesWhen multiple values are stored in one column, problems occur:
Difficult Searching
Difficult Updating
Poor Data Integrity
Complex Queries1NF ensures data is stored in a clean and predictable format.
Understanding Atomic Values
Atomic values are values that cannot be further divided within the database context.
Correct:
| StudentID | StudentName |
|---|---|
| 1 | Rahul |
| 2 | Priya |
Each cell contains:
One ValueIncorrect:
| StudentID | StudentName |
|---|---|
| 1 | Rahul, Priya |
The StudentName column contains:
Multiple ValuesThis violates 1NF.
Rule 1: Every Column Must Contain Atomic Values
Wrong Example:
| StudentID | PhoneNumbers |
|---|---|
| 1 | 9876543210,8765432109 |
Problems:
Hard To Search
Hard To Update
Hard To ValidateCorrect Example:
| StudentID | PhoneNumber |
|---|---|
| 1 | 9876543210 |
| 1 | 8765432109 |
Now each row contains:
One Valueand satisfies 1NF.
Rule 2: No Repeating Groups
Repeating groups occur when multiple columns store the same type of information.
Wrong Example:
| StudentID | Subject1 | Subject2 | Subject3 |
|---|---|---|---|
| 1 | Math | Science | English |
Problems:
Limited Number Of Subjects
Poor Scalability
Difficult QueriesCorrect Design:
| StudentID | Subject |
|---|---|
| 1 | Math |
| 1 | Science |
| 1 | English |
Now the structure is flexible.
Rule 3: Each Row Must Be Unique
Every row should be uniquely identifiable.
Example:
| StudentID | StudentName |
|---|---|
| 1 | Rahul |
| 2 | Priya |
StudentID acts as:
Primary Keyensuring uniqueness.
Example of a Table Not in 1NF
Consider the following table:
| OrderID | Customer | Products |
|---|---|---|
| 101 | Rahul | Laptop, Mouse |
| 102 | Priya | Keyboard, Monitor |
Problems:
Multiple Products
Stored In One CellViolates 1NF.
Converting the Table to 1NF
Normalized Table:
| OrderID | Customer | Product |
|---|---|---|
| 101 | Rahul | Laptop |
| 101 | Rahul | Mouse |
| 102 | Priya | Keyboard |
| 102 | Priya | Monitor |
Now:
Each Cell Contains One Valueand the table satisfies 1NF.
Another Example
Before 1NF:
| EmployeeID | Skills |
|---|---|
| 1 | Java, SQL, Python |
Problems:
Multiple Skills
In One ColumnAfter 1NF:
| EmployeeID | Skill |
|---|---|
| 1 | Java |
| 1 | SQL |
| 1 | Python |
The structure becomes relational.
Real-World Example: Student Database
Wrong Design:
| StudentID | Courses |
|---|---|
| 101 | DBMS, Java, Python |
Correct Design:
| StudentID | Course |
|---|---|
| 101 | DBMS |
| 101 | Java |
| 101 | Python |
This satisfies 1NF.
Real-World Example: E-Commerce
Wrong Design:
| OrderID | Products |
|---|---|
| 1 | Laptop, Mouse, Keyboard |
Correct Design:
| OrderID | Product |
|---|---|
| 1 | Laptop |
| 1 | Mouse |
| 1 | Keyboard |
Each row contains one product.
Real-World Example: Hospital System
Wrong Design:
| PatientID | Diseases |
|---|---|
| 1 | Fever, Diabetes |
Correct Design:
| PatientID | Disease |
|---|---|
| 1 | Fever |
| 1 | Diabetes |
Atomic values are maintained.
Benefits of First Normal Form
Eliminates Repeating Groups
Data becomes more organized.
Improves Query Simplicity
Searching becomes easier.
Better Data Integrity
Values remain consistent.
Supports Relational Design
Tables become easier to connect.
Foundation for Higher Normal Forms
Required before applying:
2NF
3NF
BCNFLimitations of 1NF
Although 1NF improves structure, it does not eliminate all redundancy.
Example:
| StudentID | StudentName | Department |
|---|---|---|
| 1 | Rahul | CSE |
| 2 | Priya | CSE |
Department data is still repeated.
This issue is solved in:
Second Normal Form (2NF)Common Mistakes
Storing Multiple Values in One Column
Wrong:
Java, Python, SQLCreating Subject1, Subject2, Subject3 Columns
Creates repeating groups.
Ignoring Primary Keys
Rows should be uniquely identifiable.
Assuming 1NF Eliminates All Redundancy
It only solves atomicity issues.
Best Practices
Store One Value Per Cell
Always maintain atomic values.
Avoid Repeating Groups
Create separate rows instead.
Use Primary Keys
Ensure row uniqueness.
Think Relationally
Store data in a structured manner.
Prepare for Higher Normal Forms
1NF is only the first step.
Common Interview Questions
What is First Normal Form (1NF)?
A table is in 1NF when every column contains atomic values and no repeating groups exist.
What is an Atomic Value?
A single indivisible value.
Does 1NF Remove Data Redundancy?
Partially, but not completely.
What problem does 1NF solve?
Multi-valued attributes and repeating groups.
Can a table with comma-separated values be in 1NF?
No.
Each cell must contain a single value.
Summary
First Normal Form (1NF) is the foundation of database normalization. It ensures that every column contains atomic values, eliminates repeating groups, and creates a structured relational design that can be further normalized into higher normal forms.
In this lesson, you learned:
- What First Normal Form is
- Atomic Values
- Repeating Groups
- 1NF Rules
- Converting tables into 1NF
- Real-world examples
- Benefits and limitations
- Best practices
- Interview questions
Mastering 1NF is essential because every properly normalized database begins with First Normal Form.
Next Step
Continue to the next lesson:
Second Normal Form (2NF) →
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for First Normal Form 1NF.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this SQL topic.
Search Terms
sql, sql complete guide, sql tutorial, sql notes, complete, guide, normalization, first
Related SQL Topics