select dept_no ,emp_no ,round(avg(maxSalary),0) maxSalary from ( select dept_no ,first_value(dept_emp.emp_no)over(partition by dept_no order by salary desc) emp_no ,max(salary)over(partition by dept_no) maxSalary from dept_emp left join salaries on dept_emp.emp_no = salaries.emp_no ) a group...