Hello all,
I am designing a DB that will track employee salary costs on an ongoing basis. The biggest snag I have run into is how to handle when employees receive a pay raise (which happens yearly). My thoughts are to use a join table that uses a dual primary key. Something like this:
EmployeeID(PK) SalaryID(PK) Effective Date
1 1 2008/10/01
1 2 2009/10/01
etc...
This table, would of course contain the foreign keys from the Employee Table and the Salary Table. My resulting queries would select using a WHERE Effective Date <= type of statement.
As I am just in the planning phase, I just wanted to check and see if my logic is clear or if there is a better way to handle these changes in salary.
Thanks in advance,
D
I am designing a DB that will track employee salary costs on an ongoing basis. The biggest snag I have run into is how to handle when employees receive a pay raise (which happens yearly). My thoughts are to use a join table that uses a dual primary key. Something like this:
EmployeeID(PK) SalaryID(PK) Effective Date
1 1 2008/10/01
1 2 2009/10/01
etc...
This table, would of course contain the foreign keys from the Employee Table and the Salary Table. My resulting queries would select using a WHERE Effective Date <= type of statement.
As I am just in the planning phase, I just wanted to check and see if my logic is clear or if there is a better way to handle these changes in salary.
Thanks in advance,
D