A data engineer needs to find all customers who have never placed an order. The customers table contains customer_id, customer_name, and other customer attributes. The orders table contains order_id, customer_id, and other order attributes. Both tables share customer_id as the join key. The result must include only customer columns with no order-related columns in the output.
Which expression exactly achieves this requirement?
Show answer and explanation
Correct answer: B
A left anti-join returns rows from the left DataFrame only when no matching key exists on the right. Placing customers on the left and orders on the right therefore selects customers whose customer_id has no order match. Anti-join output contains only the left-side customer columns, so no additional projection is needed to remove order attributes.