Planning Join Paths
Learn how to connect data across tables.
Step 1: Start with a problem, not code
So far, you’ve executed joins. Now let’s learn to plan them.
Imagine your database has three tables:
employeescontainsemployee_id,name,department_id.departmentscontainsdepartment_id,department_name,manager_id.managerscontainsmanager_id,manager_name.
And your question is: What is each employee’s name, their department name, and their manager’s name?
Before writing SQL, pause.
Can you visualize the path of relationships? Try to map it mentally or sketch it: employees → departments → managers
Prompt hint: Describe how to plan the join path between employees, departments, and managers to answer the ...