Last answered:

08 Mar 2023

Posted on:

08 Mar 2023

1

Alternative solution

Hi, here is an alternative solution to this problem:


CREATE OR REPLACE VIEW v_avg_manager_salary AS
    SELECT 
        ROUND(AVG(s.salary), 2)
    FROM
        salaries s
    WHERE
        s.emp_no IN (SELECT 
                m.emp_no
            FROM
                dept_manager m);


Is the solution provided better in any way?


Thanks.

1 answers ( 0 marked as helpful)
Instructor
Posted on:

08 Mar 2023

1

Hi Guillem!
Thanks for reaching out.


No, your solution is also valid.


Hope this helps.
Best,
Tsvetelin

Submit an answer