Last answered:

23 Dec 2022

Posted on:

20 Nov 2022

0

can we write the query like this:

SELECT *
FROM employees e
WHERE (e.hire_date BETWEEN '1990-01-01' AND '1995-01-01' )
                AND e.emp_no IN( SELECT dm.dept_no FROM dept_manager dm);

3 answers ( 0 marked as helpful)
Posted on:

20 Nov 2022

1

It executed without errors but it didn't return any row?

Instructor
Posted on:

23 Nov 2022

0

Hi Ekaterina!
Thanks for reaching out.

The query is correct in terms of syntax but as Yumma said it returns 0 rows. Please, stick to the provided solution as this method does not work.

Hope this helps.
Best,
Tsvetelin

Posted on:

23 Dec 2022

0

Your queryimage did not return any row because you do not link the two tables. You used "e.emp_no" before the "in" and "dm.dept_no" after the select in the subquery.
If you change the "dm.dept_no" to "dm.emp_no" in the subquery, your query should be fine.

Submit an answer