Last answered:

18 Nov 2022

Posted on:

16 Nov 2022

0

Joining through dept_emp instead of dept_manager

Why does joining through dept_emp give a different result?
Does that mean dept_emp has null values that aren't in  dept_manager?
image.png

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

18 Nov 2022

1

Hi Christopher!
Thanks for reaching out.

This is because the dept_emp table has more records. The idea is to use the dept_manager table because it contains records only for managers, whereas the dept_emp table contains records for both employees and managers. Also, you should use the GROUP BY clause to obtain the average salary for each department.

Hope this helps.
Best,
Tsvetelin

Submit an answer