Databricks Certified Associate Developer for Apache Spark — Question 220

Which of the following code blocks returns a DataFrame containing only the rows from DataFrame storesDF where the value in column sqft is less than or equal to 25,000 AND the value in column customerSatisfaction is greater than or equal to 30?

Answer options

Correct answer: D

Explanation

The correct answer is D because it properly uses parentheses to ensure the logical conditions are evaluated correctly and utilizes the correct syntax for the filter method. Options A and E incorrectly use 'and' instead of '&', while B lacks quotes around the column names, and C does not use parentheses to clarify the logical conditions.