why didn't we use hire date from employees instead of from_date from dept_emp?
why didn't we use hire date from employees instead of from_date from dept_emp?
Hi Mai!
Thanks for reaching out.
The hire_date column indicates the date that the employee has started working. The from_date and to_date columns indicate the start date and the end date for the current work that the employee has worked. Let's check for emp_no=10001. If we run the following query:
SELECT
*
FROM
employees
WHERE
emp_no = 10001;
we see Georgi Facello has started working at 1986-06-26. This is his career start for the company. But in this company he has worked at different positions during different periods. If we run the following query:
SELECT
*
FROM
salaries
WHERE
emp_no = 10001;
we see all different periods of work with all salaries and the columns from_date and to_date for all his previous jobs. If he is currently working at particular position the date is set to 9999-01-01.
Hope this helps.
Best,
Tsvetelin