
Explanation:
Understanding the different Set Operators in Databricks SQL is key to solving this problem. Here's a brief overview:
SELECT statement not returned by the second SELECT statement.SELECT statements.The correct query uses EXCEPT to find customer IDs in the customers table not found in the orders table, thus identifying customers who haven't placed any orders.
Ultimate access to all questions.
No comments yet.
A data engineer is tasked with identifying customers who have not placed any orders on an e-commerce platform. They have two Delta tables: customers, containing details of registered customers, and orders, containing details of orders placed. Which query correctly identifies these customers?
A
SELECT customer_id FROM customers INTERSECT SELECT order_customer_id FROM orders
B
SELECT customer_id FROM customers UNION SELECT order_customer_id FROM orders
C
SELECT customer_id FROM customers c INNER JOIN orders o ON c.customer_id = o.order_customer_id
D
SELECT customer_id FROM customers UNION ALL SELECT order_customer_id FROM orders
E
SELECT customer_id FROM customers EXCEPT SELECT order_customer_id FROM orders