Ravindra BagaleCourses & study guides Track your progress

29. SQL for Excel Users (Term Map + Side-by-Side)

29.3 JOIN = XLOOKUP / Power Query Merge

Why. XLOOKUP / Merge bring columns from another table — JOIN does that in SQL.

What. INNER JOIN keeps matches. LEFT JOIN keeps all left rows (like merge left).

How. Idea now; deep JOIN chapters come later — still show one tiny join.

Steps

  1. Match orders to customer names.
  2. See customer_id as the lookup key.
  3. Link Power Query Merge in your mind.

Examples

Example 1 · dataset: raja_coffee

SELECT o.order_id, c.name, o.city, o.amount_inr
FROM orders AS o
JOIN customers AS c ON c.customer_id = o.customer_id
ORDER BY o.order_id
LIMIT 5;

Output

order_idnamecityamount_inr
1001Asha PatilPune840.0
1002Omar KhanMumbai720.0
1003Sofia MendesGoa890.0
1004James OkonkwoPune1050.0
1005Priya DeshmukhKolhapur620.0

Meaning. Lookup customer name onto each order.

Ravindra Bagale's Tip

If row counts explode after a join, you have a many-to-many — stop and check keys.