Databricks Certified Data Analyst Associate — Question 44

A data analyst needs to query the data in my_table. They want to return the values in columns user_id and email_address where records fit the following filter criteria: age is greater than 25 and country is Canada. The analyst does not want to return values from any other columns.

Which code block will accomplish the above task?

Answer options

Correct answer: B

Explanation

The correct answer B retrieves only the user_id and email_address columns for records where age is greater than 25 and the country is Canada, fulfilling the analyst's requirements. Option A returns all columns, which is not desired. Option C retrieves the wrong columns (age and country), and option D has incorrect conditions that do not match the requirements (age = 25 and country > 'Canada').