如果本题仅仅是查找各部门领导的薪水和编号的话,就是将两张表连接一下再查询,即:

select
    s.emp_no,
    s.salary,
    s.from_date,
    s.to_date,
    d.dept_no
from
    salaries as s
join
    dept_manager as d
on
    s.emp_no = d.emp_no
order by
    s.emp_no asc
;

        但是题目里有个“当前”,大概是指salaries表和dept_manager表中包含了所有在职和离职员工,因此需要把已经离职的员工去除。
        离职员工的to_date应该是一个确切的日期,而在职员工的to_date都是“9999-01-01”,表示一直在职,故只需筛出所有to_date = ‘9999-01-01’的员工即可。
        改进后:

select
    s.emp_no,
    s.salary,
    s.from_date,
    s.to_date,
    d.dept_no
from
    salaries as s
join
    dept_manager as d
on
    s.emp_no = d.emp_no
where
    s.to_date = '9999-01-01'
and
    d.to_date = '9999-01-01'
order by
    s.emp_no asc
;