I caluculated avg salary of each Manager
create or replace view v_avg_salary_manager AS
SELECT
dm.emp_no,
s.avg_salary
FROM
dept_manager dm
INNER JOIN
(SELECT emp_no, round(AVG(salary),2) as avg_salary
FROM salaries s1
GROUP BY emp_no) s ON dm.emp_no = s.emp_no;
1 answers ( 0 marked as helpful)
Hi Uzair!
Thanks for reaching out.
Overall, your query looks well-constructed for the purpose described. Keep in mind to test it on your database to ensure it captures all intended data correctly and performs efficiently.
Hope this helps.
Best,
Tsvetelin