You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question: Filter employees who have emp_no 110183 as a manager
*/
Answer:
-- Written with JOIN
SELECT e.emp_no, first_name, last_name
FROM employees as e
JOIN dept_emp as de USING (emp_no)
JOIN dept_manager as dm USING (dept_no)
WHERE dm.emp_no = 110183
In this answer, if we write it like that we will see all the employees who are in the department - d003.
In that dep are 2 managers. and emp_no = 110183 was manager only until 1992-03-21.
My resolution to this:
Select * from "public"."employees" as e
join dept_emp as de on de.emp_no = e.emp_no
join dept_manager as d on d.dept_no = de.dept_no
where d.emp_no = 110183 and de.to_date <= '1992-03-21'
.
Let me know if I'm wrong. Thank you
The text was updated successfully, but these errors were encountered:
Question:
/*
*/
Answer:
-- Written with JOIN
SELECT e.emp_no, first_name, last_name
FROM employees as e
JOIN dept_emp as de USING (emp_no)
JOIN dept_manager as dm USING (dept_no)
WHERE dm.emp_no = 110183
In this answer, if we write it like that we will see all the employees who are in the department - d003.
In that dep are 2 managers. and emp_no = 110183 was manager only until 1992-03-21.
My resolution to this:
Select * from "public"."employees" as e
join dept_emp as de on de.emp_no = e.emp_no
join dept_manager as d on d.dept_no = de.dept_no
where d.emp_no = 110183 and de.to_date <= '1992-03-21'
.
Let me know if I'm wrong. Thank you
The text was updated successfully, but these errors were encountered: