QuestionQ79

VerifiedAnalyzing Queries

Consider these two statements:

Statement 1:

Question Image

Statement 2:

Question Image

Which option describes how the result sets differ when each statement is executed in Databricks SQL?

Explanation

A LEFT SEMI JOIN returns rows from the left table only when a matching row exists in the right table. A LEFT ANTI JOIN returns rows from the left table only when no matching row exists in the right table. With customers on the left and matching on customer_id, the first statement returns customers with at least one order, while the second returns customers with no orders.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!