Database normalization is the process of organizing data into related tables to reduce unnecessary duplication and improve data consistency. In Microsoft Access, normalization helps you design databases that are easier to maintain and manage.
Normalization divides data into appropriate tables and connects those tables using keys and relationships. Instead of storing the same information repeatedly, related information is stored in its proper table.
| StudentID | StudentName | Course1 | Course2 |
|---|---|---|---|
| 101 | Rahul Kumar | ADCA | Tally Prime |
| 102 | Priya Singh | ADCA | Web Development |
| 103 | Amit Kumar | Tally Prime | Web Development |
Problems with this design include:
Suppose the course name ADCA is stored in hundreds of student records. If the course name changes, many records may need updating. If course details are stored once in a Courses table, the course name can be updated in one place.
An insertion anomaly occurs when it is difficult to add one piece of information without adding unrelated data.
Example: You want to add a new course, but your table requires a student record before you can store the course information.
An update anomaly occurs when the same information is stored in multiple places and all copies must be changed.
Example: The name of a course appears in many records. Updating only some records leaves inconsistent names.
A deletion anomaly occurs when deleting one record accidentally removes other information that should have been retained.
Example: If the only student enrolled in a course is deleted from a combined table, the course information may also be lost.
A table is in First Normal Form (1NF) when each field contains a single value and repeating groups are not stored as multiple columns or multiple values in one field.
| StudentID | StudentName | Courses |
|---|---|---|
| 101 | Rahul Kumar | ADCA, Tally Prime |
| 102 | Priya Singh | ADCA, Web Development |
The Courses field contains multiple course values in one field.
| StudentID | StudentName | CourseName |
|---|---|---|
| 101 | Rahul Kumar | ADCA |
| 101 | Rahul Kumar | Tally Prime |
| 102 | Priya Singh | ADCA |
| 102 | Priya Singh | Web Development |
Each row now stores one student-course combination. In a real database, a suitable key or a separate enrollment table should identify each combination.
A table is in Second Normal Form (2NF) when it is in 1NF and every non-key attribute depends on the whole candidate key, not just part of a composite key.
Suppose an Enrollment table uses the combination of StudentID and CourseID as its primary key.
Enrollment
--------------------------------
StudentID Composite Key
CourseID Composite Key
StudentName
CourseName
EnrollmentDate
StudentName depends only on StudentID, while CourseName depends only on CourseID. These are partial dependencies on parts of the composite key.
Students Table
Students
-------------------------
StudentID Primary Key
StudentName
Courses Table
Courses
-------------------------
CourseID Primary Key
CourseName
Enrollment Table
Enrollment
-------------------------
StudentID Foreign Key
CourseID Foreign Key
EnrollmentDate
Primary Key: StudentID + CourseID
A table is in Third Normal Form (3NF) when it satisfies 2NF and non-key attributes do not depend transitively on a candidate key.
Consider the following Students table:
Students
--------------------------------
StudentID
StudentName
DepartmentID
DepartmentName
StudentID determines DepartmentID, and DepartmentID determines DepartmentName. Therefore, DepartmentName depends on StudentID through DepartmentID.
Students Table
Students
-------------------------
StudentID Primary Key
StudentName
DepartmentID Foreign Key
Departments Table
Departments
-------------------------
DepartmentID Primary Key
DepartmentName
DepartmentName is now stored in the Departments table, where it depends directly on DepartmentID.
| Normal Form | Main Requirement | Problem Addressed |
|---|---|---|
| 1NF | Single values in fields; no repeating groups | Repeating groups and multiple values in one field |
| 2NF | 1NF plus no partial dependency on a composite key | Partial dependencies |
| 3NF | 2NF plus no transitive dependency of non-key attributes | Transitive dependencies |
Each normal form builds on the requirements of the preceding normal form.
Design a normalized student management database using three related tables.
StudentID AutoNumber, Primary Key
StudentName Short Text
Mobile Short Text
DepartmentID Number, Foreign Key
DepartmentID AutoNumber, Primary Key
DepartmentName Short Text
CourseID AutoNumber, Primary Key
CourseName Short Text
CourseFee Currency
If students can enroll in multiple courses and courses can have multiple students, create an additional Enrollment table:
Enrollment
-------------------------
StudentID Foreign Key
CourseID Foreign Key
EnrollmentDate Date/Time
Primary Key: StudentID + CourseID
Create relationships from Students to Enrollment and from Courses to Enrollment. This represents a many-to-many relationship through a junction table.
Create a normalized database for a computer training institute.
1. What is the main purpose of database normalization?
2. Which normal form requires fields to contain single values and avoids repeating groups?
3. What does Third Normal Form help remove?