Databricks Data Engineer Associate exam dumps

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

Single answer

A data engineering team is tasked with validating that a specific value, 'null', is not present in the 'customer_id' field of the Delta Lake table 'customers'. Which of the following options is the correct way to validate this requirement?

  1. A

    SELECT * FROM customers WHERE customer_id IS NULL

  2. B

    SELECT * FROM customers WHERE customer_id IS NOT NULL

  3. C

    SELECT COUNT(*) FROM customers WHERE customer_id IS NULL

  4. D

    SELECT DISTINCT customer_id FROM customers WHERE customer_id = 'null'

Show answer and explanation

Correct answer: C

Explanation

To validate that NULL is not present in a specific field, you need to count the rows where the field is NULL. If the count is 0, it confirms that there are no NULL values in that field. In this case, using 'SELECT COUNT(*) FROM customers WHERE customer_id IS NULL' will provide the correct validation, as it explicitly checks for rows with NULL values.

  • A. Incorrect.

    This option checks for rows where 'customer_id' is NULL, but it does not validate that NULL is not present. Instead, it retrieves rows with NULL values.

  • B. Incorrect.

    This option retrieves rows where 'customer_id' is NOT NULL, but it does not confirm that NULL values are entirely absent in the 'customer_id' field.

  • C. Correct.

    This option counts the number of rows where 'customer_id' is NULL, which is the correct approach to validate whether NULL values are present. If the count is 0, it confirms that NULL is not present.

  • D. Incorrect.

    This option incorrectly assumes the 'null' value is a string literal, which is not the same as the NULL value in SQL. Hence, it cannot validate the absence of NULL in 'customer_id'.

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