I have been put in charge of redeveloping a prety large database application. The existing application has several hundred stored procs and at least that many tables. The problem I see with it is that the data appears to be duplicated in many places. I'd like to simplify the database and put in place relationships that make sense, not only now, but to anyone looking at the data in the future.
For now, I would like to just work on cleaning up the most egregious problems and get to the others at some other point.
So should I break out duplicated data and place it into related tables with a 1 to ~ relationship? As far as that is concerned, what is the general rule when dealing with records where there may be duplicated information. Does it make sense to create another table when there aren't alot of fields that are duplicated?
An example might be a table where there are records with several duplicated fields and two distinct fields. Creating a table for the distinct fields and creating a ~ to 1 relationship with the originating table would allow the removal of all records where the several fields were duplicated.
For example, instead of having an employee table with DepartmentName and DepartmentManager (a nightmare to administer by the way) you might have an employee table with DepartmentID and let the department table keep all data related to the department, because you will likely have multiple employees for each department, although this wouldn't allow a user to be part of multiple departments unless either the record was duplicated with a different departmentID or another table is used to map EmployeeID and DepartmentID to the respective records in the other tables.
Any advice from the gurus would be greatly appreciated.
For now, I would like to just work on cleaning up the most egregious problems and get to the others at some other point.
So should I break out duplicated data and place it into related tables with a 1 to ~ relationship? As far as that is concerned, what is the general rule when dealing with records where there may be duplicated information. Does it make sense to create another table when there aren't alot of fields that are duplicated?
An example might be a table where there are records with several duplicated fields and two distinct fields. Creating a table for the distinct fields and creating a ~ to 1 relationship with the originating table would allow the removal of all records where the several fields were duplicated.
For example, instead of having an employee table with DepartmentName and DepartmentManager (a nightmare to administer by the way) you might have an employee table with DepartmentID and let the department table keep all data related to the department, because you will likely have multiple employees for each department, although this wouldn't allow a user to be part of multiple departments unless either the record was duplicated with a different departmentID or another table is used to map EmployeeID and DepartmentID to the respective records in the other tables.
Any advice from the gurus would be greatly appreciated.