Last answered:

22 May 2023

Posted on:

13 May 2023

0

alternative code

Is this a valid solution?


CREATE OR REPLACE VIEW v_dm_salary AS
    SELECT 
        ROUND(AVG(salary), 2) AS ave_salary
    FROM
        salaries s
    WHERE
        EXISTS( SELECT 
                dm.emp_no
            FROM
                dept_manager dm
            WHERE
                s.emp_no = dm.emp_no);
            
SELECT 
    *
FROM
    v_dm_salary;

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

22 May 2023

0

Hi Jake!
Thanks for reaching out.


Yes, this is also a valid solution. Bravo!


Hope this helps.
Best,
Tsvetelin

Submit an answer