QuestionQ67

Executing queries using Databricks SQL and Databricks SQL Warehouses

A data analyst has been asked to identify which customers have placed an order during the past year and which customers have not placed an order during the past year. This can be determined with a single statement by joining the customers table (which is unique by customer ID) with the orders table.

Which type of join should the data analyst use?

  • A Left Semi Join
  • B Left Join
  • C Middle Join
  • D Left Anti Join
Explanation

A left join preserves all customers, including those with no qualifying order in the past year. Matched customers have associated order data, while customers without a match have NULL values for the orders-table columns, allowing both groups to be identified in one result.

Community Discussion

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