The ON clause tells SQL how rows from joined tables relate. For example, an order stores a CustomerID, and the customer table stores the matching CustomerID. JOIN names the extra table; ON states the matching condition. section 8.2.1
SELECT
orderheader.CustomerID,
customer.FirstName,
customer.LastName
FROM orderheader
JOIN customer
ON orderheader.CustomerID = customer.CustomerID
WHERE orderheader.OrderID = 1001;
This query joins orderheader to customer through their shared CustomerID, then returns the first order’s customer name. section 8.2.1
