Question: Draw the query tree for each SQL. Explain what kinds of join methods are used in each query tree. Explain why one outperforms the other.
#1 .SELECT E.emp_no, E.first_name, E.last_name
FROM employees E
WHERE EXISTS ( SELECT S.emp_no
FROM salaries S WHERE S.emp_no = E.emp_no
INTERSECT SELECT DM.emp_no
FROM dept_manager DM
WHERE DM.emp_no = E.emp_no);
#2.SELECT DISTINCT E.emp_no, E.first_name, E.last_name
FROM employees E, salaries S, dept_manager DM
WHERE S.emp_no = E.emp_no AND DM.emp_no = E.emp_no