Hi there,
I just cannot undertsand we need to make a recursive join to get info on 2 columns within one same table as in lesson 5/9 within the “Intermediate Joins in SQL” mission. Instead of using the proposed query:
SELECT
e1.employee_id,
e2.employee_id supervisor_id
FROM employee e1
INNER JOIN employee e2 on e1.reports_to = e2.employee_id
LIMIT 4;
Why not use a query like the one below?
SELECT
employee_id,
reports_to supervisor_id
FROM employee
LIMIT 4
This particular query only selects the employee_id from e2, so it looks like a redundant join.
However, if you were to look for additional information about the supervisor, for example, the name of the supervisor, then you will need the recursive join, since the only information about the supervisor in e1 is the id.