In the exercise, we had to display the number of department managers who were hired between the 1st of January 1990 and the 1st of January 1995. According to the solution, the displayed date after execution is the from & to dates. On the contrary shouldn’t it be the hire date? Also, I tried the question without using a subquery and got a slightly different result which looked more appropriate according to the question. Waiting for your response. I am just wondering. I may be wrong.
FROM employees e
JOIN dept_manager d ON e.emp_no=d.emp_no
WHERE e.hire_date BETWEEN ‘1990-01-01’ AND ‘1995-01-01’
ORDER bY e.emp_no;
Thanks for reaching out.
This is a great observation indeed!
In fact, what we achieve with the query we suggest is an output as obtained from the dept_managers table for all managers that have been hired in the company for the first time between Jan 1 1990 and Jan 1 1995. We don’t display any information from the employees table.
The query you suggest responds to this part of the question. However, it doesn’t involve the use of a subquery, which is what the purpose of the exercise is about.
Thank you very much for paying attention to this subtlety! I will revise it with my colleagues and will update the task text/suggested solution accordingly.
Hope this helps.
Hey Martin! But the question in that exercise was to display the information about all department managers who were hired between the 1st of January 1990 and the 1st of January 1995. And for that, I must need contents such as the “names”, which I can get only from the employees table. Right?
Hi Archisman! Yes, but we didn’t specify in the task what information to obtain, so we’ve provided a solution with the employee numbers only. Again, our intention was to implement a subquery, rather than focus on additional techniques. Nevertheless, thank you very much for your comment once again!
Okay Martin! Thanks a lot for the much-needed clarifications.
You are very welcome! Best, Martin