Need clarification on why using e.emp_no < 10011 in the WHERE clause
I can't make sense of the condition you have suggested in the query at all, the prompt asks us for the first 10 employees, so I think we should use a condition like emp_no BETWEEN 110022 AND 110032. Below is the code I had run:
SELECT
e.*, d.*
FROM
employees e
CROSS JOIN
departments d
WHERE
emp_no BETWEEN 110022 AND 110032
ORDER BY e.emp_no;
Hi Saeed!
Thanks for reaching out.
Yes, you can use the BETWEEN operator. However, the first employee starts with number 10001. So, please use the following code:
SELECT
e.*, d.*
FROM
employees e
CROSS JOIN
departments d
WHERE
emp_no BETWEEN 10001 AND 10010
ORDER BY e.emp_no;
Hope this helps.
Best,
Tsvetelin
Also I had to add "GROUP BY e.emp_no" just before "ORDER BY e.emp_no;" as it was giving me 90 rows instead of 10. In case it helps.
It really should result into 90 rows, since we are assigning each of the 10 employees with 9 possible departments.