Databricks Data Engineer Associate exam dumps

Databricks Data Engineer Associate practice question 181 of 532

Databricks Certified Data Engineer Associate. Associate level, Databricks. Free question with the correct answer and a full explanation.

Databricks Data Engineer Associate Question 181

Select 4

You are working with two tables in Databricks: customers and orders. The customers table contains customer information with columns customer_id and customer_name. The orders table contains order details with columns order_id, customer_id, and order_amount. You execute the following query:

SELECT c.customer_id, c.customer_name, o.order_id, o.order_amount FROM customers c LEFT JOIN orders o ON c.customer_id = o.customer_id;

Given the following data in the tables:

customers:

customer_idcustomer_name
1Alice
2Bob
3Charlie

orders:

order_idcustomer_idorder_amount
101150
102130
103270

What will be the result of this query?

  1. A
    customer_idcustomer_nameorder_idorder_amount
    1Alice10150
  2. B
    customer_idcustomer_nameorder_idorder_amount
    1Alice10230
  3. C
    customer_idcustomer_nameorder_idorder_amount
    2Bob10370
  4. D
    customer_idcustomer_nameorder_idorder_amount
    3CharlieNULLNULL
  5. E
    customer_idcustomer_nameorder_idorder_amount
    2BobNULLNULL
Show answer and explanation

Correct answers: A, B, C, D

Explanation

The query performs a LEFT JOIN between customers and orders on the customer_id column. For customers with matching orders, all matching rows from the orders table are included. For customers without matching orders, a row is included with NULL values for the columns from the orders table. In this case, Alice has two matching orders, Bob has one matching order, and Charlie has no matching orders, resulting in four rows in the output.

  • A. Correct.

    This row is included because Alice (customer_id = 1) has a matching order (order_id = 101) in the orders table.

  • B. Correct.

    This row is included because Alice (customer_id = 1) has a second matching order (order_id = 102) in the orders table.

  • C. Correct.

    This row is included because Bob (customer_id = 2) has a matching order (order_id = 103) in the orders table.

  • D. Correct.

    This row is included because Charlie (customer_id = 3) does not have any matching orders in the orders table. Since this is a LEFT JOIN, NULL values are returned for the order_id and order_amount columns for unmatched rows.

  • E. Incorrect.

    This row is incorrect because Bob (customer_id = 2) has a matching order, so there will not be a row with NULL values for order_id and order_amount.

Timed practice exam

Take a Databricks Data Engineer Associate practice test under exam conditions

45 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam