In our previous lesson, we discussed how to normalize a denormalized table. Denormalization refers to having all data combined into a single table, which may lead to data redundancy and inconsistencies. On the left side of the diagram, you can see a denormalized table called employee
, which includes columns like employeeId
, employeeName
, departmentName
, projectName
, and other details such as salary, address, and project status.
While this structure might seem simple, it creates issues like data duplication (for example, the department name would be repeated for every employee in the same department). It also makes it harder to maintain the database—any change in a project or department would require updating multiple rows.
To solve these issues, we apply normalization, which breaks the data into multiple related tables. The right side of the diagram shows the normalized structure. Here’s what we did:
*We split the data into multiple tables: *employee
, department
, project
, manager
, and job
.
Each table now focuses on a specific entity (e.g., employee
handles employee details, department
handles department info).
We replaced the actual data with foreign keys*, linking each table. For example, employee
references departmentId
, projectId
, and jobId
instead of repeating department names or project names.
This approach improves data integrity and reduces redundancy. Any update in the department
table, for instance, will automatically reflect wherever it is used, without needing to change multiple entries. This process helps maintain a more organized and efficient database
For your Activity
Denormalized Student Table (student
)
Normalize the Table:
You are tasked with breaking down this denormalized table into multiple related tables to reduce redundancy and improve database management.
The tables are as follows:
-
Student Table - Handles basic student details.
-
Course Table - Manages course-related data.
-
Department Table - Contains department information.
-
Project Table - Includes details of student projects.
-
Scholarship Table - Contains scholarship-related information.
-
ExtracurricularActivities Table - Manages extracurricular activities.
-
Advisor Table - Tracks advisor information.
-
Attendance Table - Stores student attendance records.
3. Documentation:
- Document this process on Hashnode.com, explaining how you normalized the tables and used Lucidchart to create the relationships.