A SAS programmer discovers that two tables need to be joined on a common key but the key variable has different names: 'cust_id' in Table A and 'customer_id' in Table B. Which PROC SQL join syntax correctly handles this?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — a is correct because an explicit INNER JOIN with an ON clause correctly handles keys with different names: ON A.cust_id = B.customer_id. B uses an implicit Cartesian join syntax — without table prefixes the WHERE clause may work but is ambiguous and error-prone when columns exist in both tables.
Full explanation below image
Full Explanation
A is correct because an explicit INNER JOIN with an ON clause correctly handles keys with different names: ON A.cust_id = B.customer_id. B uses an implicit Cartesian join syntax — without table prefixes the WHERE clause may work but is ambiguous and error-prone when columns exist in both tables. C (NATURAL JOIN) automatically joins on columns with the same name, which fails here since the key names differ. D (USING) requires that both columns have the same name, so it cannot be used when the names differ.