AI And Database Normalization

Database normalization is a systematic process of organizing data in a relational database to eliminate redundancy and improve data integrity. The goal of normalization is to minimize data duplication, reduce update anomalies, and ensure efficient data retrieval by structuring the database into smaller, well-defined tables with appropriate relationships.

Normalization follows a set of normal forms (NF), each with stricter constraints to progressively refine the database schema.


Key Objectives of Normalization

  1. Eliminate Data Redundancy → Avoid storing the same data in multiple places.
  2. Ensure Data Integrity → Maintain consistency and prevent anomalies.
  3. Minimize Update, Insert, and Delete Anomalies → Prevent issues where updating, inserting, or deleting data leads to unintended consequences.
  4. Improve Query Efficiency → Structure data in a way that allows for optimal query performance.
  5. Establish Clear Relationships → Define proper Primary Keys (PK) and Foreign Keys (FK) to create meaningful links between tables.

Advanced Database Normalization Challenge

Scenario: Multi-Campus University Course Management System

You have been hired as a database consultant for a university that operates multiple campuses, each with independent but overlapping course offerings. The university wants to manage student enrollments, instructors, courses, departments, classrooms, and scheduling in a single relational database.

Currently, the university stores all data in a single unnormalized table (UNF), but serious data integrity issues have surfaced due to redundancy, inconsistencies, and update anomalies. Your task is to normalize this table to Third Normal Form (3NF).


Unnormalized Data (UNF)

RecordIDStudentIDStudentNameMajorCampusCourseCodeCourseNameCreditsInstructorInstructorPhoneRoomNoRoomCapacityClassDayClassTimeEnrollmentStatus
11001Alice BrownCSNYCS101Intro to CS3Dr. Smith555-1234A10150Monday10:00 AMEnrolled
21002Bob WhiteMathNYMATH201Linear Algebra4Dr. Jones555-5678B20240Tuesday1:00 PMEnrolled
31001Alice BrownCSNYMATH201Linear Algebra4Dr. Jones555-5678B20240Tuesday1:00 PMEnrolled
41003Carol SmithPhysicsCAPHYS301Quantum Mechanics4Dr. Taylor555-9876C30330Thursday3:00 PMEnrolled
51002Bob WhiteMathNYCS101Intro to CS3Dr. Smith555-1234A10150Monday10:00 AMWaitlisted
61004David LeeCSCACS101Intro to CS3Dr. Johnson555-3333D40445Monday10:00 AMEnrolled
71004David LeeCSCAPHYS301Quantum Mechanics4Dr. Taylor555-9876C30330Thursday3:00 PMEnrolled

Step 1: First consider the following:

  1. Primary Key: What is he primary key of this table (hint: it is composite)
  2. Redundancies: Where do you see redundancies in this table? List them all.
  3. Partial Dependencies: What are some field that are depentand on only part of the PK?
  4. Transitive Dependencies: What are some dependancies e.g. where A determines B, and B determines C?
  5. Complex Relationships: can you find any additional complexities here?

Step 2: Normalize to 3NF. Show your steps, and the final tables.

Step 3: Now use AI to normalize to 3NF

Use Ai to try to do the normalization? What do you thing? Did you find any problems?

Step 4: Compar the results

  1. Did you miss anything that AIU got right?
  2. Did AI get anything wrong that you got?

Scroll to Top