Databricks Data Engineer Associate exam dumps

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

Single answer

You are tasked with analyzing a dataset in Databricks that contains a column 'sales'. This column includes numeric values and some NULL entries. Which of the following statements accurately describes the behavior of the count() function when applied to the 'sales' column?

  1. A

    The count(sales) function includes NULL values in its count.

  2. B

    The count(sales) function skips NULL values and counts only non-NULL values.

  3. C

    The count(sales) function returns 0 if the column contains any NULL values.

  4. D

    The count(*) function skips NULL values in the 'sales' column.

Show answer and explanation

Correct answer: B

Explanation

The count(column_name) function in SQL and Spark skips NULL values in the specified column and counts only rows with non-NULL values. In this scenario, the count(sales) function will count only the rows where the 'sales' column has a value. On the other hand, count(*) counts all rows, regardless of NULL values in specific columns.

  • A. Incorrect.

    Incorrect. The count() function does not include NULL values in its count. It only counts non-NULL values.

  • B. Correct.

    Correct. The count(sales) function skips NULL values and counts only the rows where the 'sales' column has non-NULL values.

  • C. Incorrect.

    Incorrect. The count() function does not return 0 just because the column contains NULL values; it counts the rows with non-NULL values.

  • D. Incorrect.

    Incorrect. The count(*) function counts all rows in the dataset, including those with NULL values in the 'sales' column.

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