Last answered:

24 Jun 2024

Posted on:

21 Jun 2024

0

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)
Instructor
Posted on:

24 Jun 2024

0

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

Submit an answer