Resolved: why this code not valid
SELECT
m.emp_no, e.first_name,e.last_name,e.hire_date,t.title,t.from_date, d.dept_name
from
dept_number d
join
dept_manager m on d.dept_no = m.dept_no
join
employees e on m.emp_no = e.emp_no
join
titles t on e.emp_no = t.emp_no;
the error >>
Error Code: 1146. Table 'employees.dept_number' doesn't exist
Hi Abdelrahman!
Thanks for reaching out.
There is not such a table dept_number. Please, use the departments table. The code is:
SELECT
m.emp_no,
e.first_name,
e.last_name,
e.hire_date,
t.title,
t.from_date,
d.dept_name
FROM
departments d
JOIN
dept_manager m ON d.dept_no = m.dept_no
JOIN
employees e ON m.emp_no = e.emp_no
JOIN
titles t ON e.emp_no = t.emp_no;
Hope this helps.
Best,
Tsvetelin
Thank you for your concern
Hi Abdelrahman!
You are very welcome!
Best,
Tsvetelin