0% completed
The First Normal Form (1NF) is the first step in the normalization process. It enforces the rule that each attribute in a table should contain only atomic (indivisible) values, ensuring that there are no repeating groups or arrays within a column. In other words, 1NF requires that each cell in a table contains only a single value, and each row represents a unique record.
Requirements of 1NF
To satisfy the requirements of 1NF:
- Each column should contain only atomic values (no arrays or lists).
- Each column should store values of a single data type.
- All entries in a column should be unique for each row, without repeating groups.
Example 1: Student Contact Information
Consider the following Student table that does not satisfy 1NF:
Student_ID | Name | Contact_Number | Course |
---|---|---|---|
101 | Alice Smith | 123-456-7890, 098-765-4321 | Math |
102 | Bob Johnson | 234-567-8901 | Science |
103 | Carol White | 345-678-9012, 543-210-6789 | History |
In this table:
- The Contact_Number column contains multiple phone numbers separated by commas, violating the rule of atomicity.
Converting to 1NF
To bring this table into 1NF, we need to create a separate row for each contact number, ensuring each cell has only one value:
Student_ID | Name | Contact_Number |
---|---|---|
101 | Alice Smith | 123-456-7890 |
101 | Alice Smith | 098-765-4321 |
102 | Bob Johnson | 234-567-8901 |
103 | Carol White | 345-678-9012 |
103 | Carol White | 543-210-6789 |
Now, each cell contains only one value, satisfying the requirements of 1NF. Each contact number has its own row, ensuring data is atomic and each record is unique.
Example 2: Student Course Enrollment
Consider the following Student_Course table, which records the courses each student is enrolled in. This table does not satisfy 1NF because multiple courses are listed in the same cell:
Student_ID | Name | Courses |
---|---|---|
101 | Alice Smith | Math, Science |
102 | Bob Johnson | History |
103 | Carol White | Math, History, Science |
In this case:
- The Courses column contains multiple values separated by commas, which violates the 1NF rule of atomicity.
Converting to 1NF
To convert this table to 1NF, we need to split each course into its own row, ensuring that each cell contains only a single value:
Student_ID | Name | Course |
---|---|---|
101 | Alice Smith | Math |
101 | Alice Smith | Science |
102 | Bob Johnson | History |
103 | Carol White | Math |
103 | Carol White | History |
103 | Carol White | Science |
After normalization:
- Each Course value now occupies its own row, eliminating repeating groups.
- Each row represents a unique record, and each cell contains only one atomic value.
In 1NF, tables are restructured to ensure each attribute contains only atomic values, and there are no repeating groups within a table. By converting tables to 1NF, we reduce data redundancy, improve data integrity, and lay a foundation for further normalization steps.
In the next lesson, we’ll cover Second Normal Form (2NF), which builds on 1NF by addressing partial dependencies and ensuring full functional dependency on the primary key.
.....
.....
.....
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible