J
JWeaver
I apologize up front for the length of this email but I wanted to give all
pertinent information to you at the beginning.
I have a database that I inherited that I am slowly trying to fix since it
started out with a whole bunch of information in one table and I have now
created other tables for some of the repeating data. However, now I want to
make them more normalized and take away the duplicated data and wanted to see
if someone could give me some guidance. My tables are as follows:
Employees:
Emp ID – PK
Advocate Last Name
Advocate First Name
Home Dept
Hire Date
Pay Rate
Active/Inactive
Clients:
ClientID – PK
Last
First
Contracts:
ContractID – PK
Client Last Name
Client First Name
Requisition Number
Service Provided
Hours Contracted
Frequency
Date Contract Begins
Date Contract Ends
Date Contract Cancelled
County/City/Town (combo box pulls from County/City/Town table)
Referring Agency
Advocate Last Name
Advocate First Name
Other Contracts
Comments/Notes
Region
County/City/Town:
Counties - PK
Payroll:
PPE Date
ID - PK
Advocate Last
Advocate First
Emp #
Pay Rate
Last
First
Program
Contract Hours
Contract Date
From
To
Hours
ClientID – Recently added FK to Clients Table - no data entered yet
ContractID – Recently added FK to Contracts Table - no data entered yet
PPE Dates: Table is populated with all of the pay period ending dates for
the year – (No PK but should field be made a PK since it does not duplicate?)
PPE Date
Pay Weeks: Table is populated with all of the pay week info for the year
WeekID - PK
WeekStart
WeekEnd
PROPOSED CHANGES TO TABLES:
Employees:
- Add PayrollID field as FK to Payroll table
- Add ContractsID field as FK to Contracts table
Clients:
- Add ContractID field as FK to Contracts table
- Add PayrollID field as FK to Payroll table
Contracts:
- Add ClientID field as FK to Clients table and delete the Client Last Name
and Client First Name fields
- Add PayrollID field as FK to Payroll table
- Add EmpID field as FK to Employees table and delete the Advocate Last Name
and Advocate First Name fields
PPE Dates:
- Change PPE Date to PK field
Payroll:
- Add PayrollID field
- Add EmpID field as FK to Employees table and delete the Pay Rate, Advocate
Last and Advocate First fields
- Add ContractID field and delete Program, Contract Hours and Contract Date
fields
- Already added ClientID field so delete First and Last fields
- Add PPEDateID field and delete PPE Date field
- Add WeekID field and delete the From and To fields
QUESTIONS:
(1) If I make the changes above will it make my tables better and more
“normalized�
(2) Would I need to set up relationships between all PKs and FKs and enforce
referential integrity between them?
(3) How would this affect my Form since they are now set to pull certain
fields from the tables that will be deleted and replaced by FKs?
(4) How will this affect my Reports that are now set to pull from the
Payroll table only?
(5) Should I make any other changes?
I thank you in advance for any help/guidance you can give me! You folks are
great at this and I appreciate it more than I can say!!!
pertinent information to you at the beginning.
I have a database that I inherited that I am slowly trying to fix since it
started out with a whole bunch of information in one table and I have now
created other tables for some of the repeating data. However, now I want to
make them more normalized and take away the duplicated data and wanted to see
if someone could give me some guidance. My tables are as follows:
Employees:
Emp ID – PK
Advocate Last Name
Advocate First Name
Home Dept
Hire Date
Pay Rate
Active/Inactive
Clients:
ClientID – PK
Last
First
Contracts:
ContractID – PK
Client Last Name
Client First Name
Requisition Number
Service Provided
Hours Contracted
Frequency
Date Contract Begins
Date Contract Ends
Date Contract Cancelled
County/City/Town (combo box pulls from County/City/Town table)
Referring Agency
Advocate Last Name
Advocate First Name
Other Contracts
Comments/Notes
Region
County/City/Town:
Counties - PK
Payroll:
PPE Date
ID - PK
Advocate Last
Advocate First
Emp #
Pay Rate
Last
First
Program
Contract Hours
Contract Date
From
To
Hours
ClientID – Recently added FK to Clients Table - no data entered yet
ContractID – Recently added FK to Contracts Table - no data entered yet
PPE Dates: Table is populated with all of the pay period ending dates for
the year – (No PK but should field be made a PK since it does not duplicate?)
PPE Date
Pay Weeks: Table is populated with all of the pay week info for the year
WeekID - PK
WeekStart
WeekEnd
PROPOSED CHANGES TO TABLES:
Employees:
- Add PayrollID field as FK to Payroll table
- Add ContractsID field as FK to Contracts table
Clients:
- Add ContractID field as FK to Contracts table
- Add PayrollID field as FK to Payroll table
Contracts:
- Add ClientID field as FK to Clients table and delete the Client Last Name
and Client First Name fields
- Add PayrollID field as FK to Payroll table
- Add EmpID field as FK to Employees table and delete the Advocate Last Name
and Advocate First Name fields
PPE Dates:
- Change PPE Date to PK field
Payroll:
- Add PayrollID field
- Add EmpID field as FK to Employees table and delete the Pay Rate, Advocate
Last and Advocate First fields
- Add ContractID field and delete Program, Contract Hours and Contract Date
fields
- Already added ClientID field so delete First and Last fields
- Add PPEDateID field and delete PPE Date field
- Add WeekID field and delete the From and To fields
QUESTIONS:
(1) If I make the changes above will it make my tables better and more
“normalized�
(2) Would I need to set up relationships between all PKs and FKs and enforce
referential integrity between them?
(3) How would this affect my Form since they are now set to pull certain
fields from the tables that will be deleted and replaced by FKs?
(4) How will this affect my Reports that are now set to pull from the
Payroll table only?
(5) Should I make any other changes?
I thank you in advance for any help/guidance you can give me! You folks are
great at this and I appreciate it more than I can say!!!