Hi,
first of all I'm sorry for my English.
I am building a database were I want to join three tables.
Employee:
ID varchar(7)
LastName
Forename
Address
Zip
Email
....
employee_salary:
ID int(50)
employeeID varchar(7) (key from employee)
salary_from (timestamp)
salary (double)
Workinghours:
ID int(50)
employeeID varchar(7)
workStart timestamp
workStop timestamp
What I want is to join the three tables in a way that each line from working hours is joined with the correct salary and the correct person. The salary_from in table salary is the key to the sollution.
The point is that the salary can change, and when it does, a date (timestamp) is saved next to the new salary. So when you combine the working hours and the employee_salary data, you should always get the right salary for the hours from workingHours table.
Ask if this is not clear.
Thank you.
first of all I'm sorry for my English.
I am building a database were I want to join three tables.
Employee:
ID varchar(7)
LastName
Forename
Address
Zip
....
employee_salary:
ID int(50)
employeeID varchar(7) (key from employee)
salary_from (timestamp)
salary (double)
Workinghours:
ID int(50)
employeeID varchar(7)
workStart timestamp
workStop timestamp
What I want is to join the three tables in a way that each line from working hours is joined with the correct salary and the correct person. The salary_from in table salary is the key to the sollution.
The point is that the salary can change, and when it does, a date (timestamp) is saved next to the new salary. So when you combine the working hours and the employee_salary data, you should always get the right salary for the hours from workingHours table.
Ask if this is not clear.
Thank you.