Home / Data Analyst practice test / Executing queries using Databricks SQL and Databricks SQL Warehouses / Question

Databricks Data Analyst Associate · free practice question

A data analyst joins a `customers` table with an `orders` table on customer_id. Some customers have never placed an order. The analyst needs a result that…

Exam-style question on Executing queries using Databricks SQL and Databricks SQL Warehouses from the free Data Analyst practice test, with the answer and a full explanation below.

Updated November 10, 2026

Executing queries using Databricks SQL and Databricks SQL Warehouses

A data analyst joins a customers table with an orders table on customer_id. Some customers have never placed an order. The analyst needs a result that includes ALL customers, with NULL values for order columns where no matching order exists. Which join type is correct?

  1. AINNER JOIN — returns only rows where customer_id matches in both the customers and orders tables, which completely excludes customers who have never placed an order and therefore does not satisfy the requirement
  2. BLEFT JOIN (LEFT OUTER JOIN) — returns every row from the left (customers) table regardless of whether a matching row exists in the right (orders) table, filling order columns with NULL for customers who have no matching orders, which correctly satisfies the requirement
  3. CRIGHT JOIN (RIGHT OUTER JOIN) — returns every row from the right (orders) table and matching rows from the left table; customers with no orders are excluded from the result because they have no corresponding row in the orders table
  4. DCROSS JOIN — generates the Cartesian product of both tables by pairing every customer row with every order row regardless of any key relationship, producing an astronomically inflated result set that is incorrect for this use case
  5. EFULL OUTER JOIN — returns all rows from both tables with NULLs where there is no match on either side; while this does include all customers, it also introduces rows for any orders that have no matching customer, potentially adding unexpected rows to the result set
Answer & explanation

Correct answer: B

WHY B: LEFT JOIN preserves all rows from the left (customers) table and fills right-side (order) columns with NULL where no matching row exists, perfectly satisfying the requirement to include all customers. WHY NOT A: INNER JOIN excludes non-matching rows from both sides, dropping customers without orders. WHY NOT C: RIGHT JOIN preserves all rows from the right (orders) table; customers with no orders would be dropped. WHY NOT D: CROSS JOIN has no filtering condition and multiplies every row combination, producing incorrect results. WHY NOT E: FULL OUTER JOIN includes all customers but also all unmatched orders, introducing extra rows the analyst does not want.

Take the full Data Analyst practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Data Analyst Associate practice test. Take it and get a section-by-section score.

Start the free test →