Databricks Data Engineer Associate exam dumps

Databricks Data Engineer Associate practice question 180 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 180

Single answer

You have two DataFrames in Databricks: users and orders. The users DataFrame contains columns user_id and name, while the orders DataFrame contains columns order_id, user_id, and amount. You perform the following join query:

result = users.join(orders, users.user_id == orders.user_id, 'inner')

What will be the content of the resulting DataFrame result?

  1. A

    A DataFrame containing only rows where user_id exists in both users and orders, with all columns from both DataFrames.

  2. B

    A DataFrame containing all rows from users with matching rows from orders and NULLs for unmatched rows.

  3. C

    A DataFrame containing all rows from orders with matching rows from users and NULLs for unmatched rows.

  4. D

    A DataFrame containing all rows from both DataFrames, with NULLs where there is no match.

Show answer and explanation

Correct answer: A

Explanation

The query uses an inner join, which means the resulting DataFrame will only include rows where the user_id exists in both users and orders. An inner join excludes rows that do not have a match in both DataFrames.

  • A. Correct.

    Correct. An inner join returns rows where the user_id exists in both DataFrames, and all columns from both DataFrames are included in the result.

  • B. Incorrect.

    Incorrect. This describes a left join, which includes all rows from users regardless of whether there is a matching row in orders.

  • C. Incorrect.

    Incorrect. This describes a right join, which includes all rows from orders regardless of whether there is a matching row in users.

  • D. Incorrect.

    Incorrect. This describes a full outer join, which includes all rows from both DataFrames, with NULLs for unmatched rows.

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