Question 1
A financial services company needs to generate a report of all customer transactions from the work.transactions dataset. For each transaction, the report must include the customer's current city from the work.demographics dataset. The final report must include all transactions, even if a customer's demographic record is missing. If a customer's city is missing, the report should display 'Unknown'. Which PROC SQL query correctly fulfills this requirement?
Answer and explanation
Correct answer: B
This is the correct solution. A LEFT JOIN is required to ensure all records from the work.transactions table are included, regardless of a match in work.demographics. The COALESCE function is then used to replace any resulting null values in the city column with the string 'Unknown', meeting all requirements.