SELECT d.emp_no,d.salary,d.from_date,m.to_date,m.dept_no FROM salaries as d  RIGHT JOIN dept_manager as m on d.emp_no=m.emp_no;