Databricks Data Engineer Associate exam dumps

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

Single answer

You are working with a dataset in a Delta table that contains customer transaction records. The table has two fields: customer_id and primary_email. You need to validate that each customer_id is associated with only one unique primary_email. Which approach will help you achieve this validation?

  1. A

    Use a GROUP BY on customer_id and check if the count of distinct primary_email is 1 for each group.

  2. B

    Filter the dataset where customer_id has more than one primary_email and count the number of records.

  3. C

    Perform a JOIN between the table and itself on customer_id and check for mismatched primary_email values.

  4. D

    Use a DISTINCT operation on primary_email and count the number of records to ensure uniqueness.

Show answer and explanation

Correct answer: A

Explanation

To validate that each customer_id is associated with exactly one unique primary_email, you need to group the data by customer_id and ensure that the count of distinct primary_email values for each group is 1. This approach directly verifies the one-to-one relationship between the two fields.

  • A. Correct.

    Correct: Grouping by customer_id and checking if the count of distinct primary_email is 1 ensures that each customer_id is associated with only one unique primary_email.

  • B. Incorrect.

    Incorrect: While filtering for records with multiple primary_email values could help identify duplicates, it does not directly validate that all customer_id values are unique to one primary_email.

  • C. Incorrect.

    Incorrect: A self-join can be used to compare records, but it is not an optimal or straightforward way to validate uniqueness in this scenario.

  • D. Incorrect.

    Incorrect: Using DISTINCT on primary_email only ensures uniqueness of email values but does not validate the relationship between customer_id and primary_email.

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