The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Solution Modification

Solution Modification

Super Learner
0
Votes
1
Answer

Hello!
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. 
SELECT e.emp_no,e.first_name,e.last_name,e.hire_date,d.dept_no
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;

1 Answer

365 Team

Hi Archisman!
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.
Kind regards,
Martin

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?

2 weeks

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!

2 weeks

Okay Martin! Thanks a lot for the much-needed clarifications.

2 weeks

You are very welcome! Best, Martin

2 weeks
×
Online Data Science Training
SAVE 60%