nerdexam
DatabricksDatabricks

CERTIFIED-DATA-ANALYST-ASSOCIATE · Question #85

CERTIFIED-DATA-ANALYST-ASSOCIATE Question #85: Real Exam Question with Answer & Explanation

The correct answer is C: products[0]. Option C (products[0]) is correct because arrays in most query languages (BigQuery, Python, JavaScript, etc.) use zero-based indexing, meaning the first element is at index 0, accessed with bracket notation [0]. Why the distractors are wrong: A (products.1) - Dot notation with a

Question

A data analyst is working with a nested array column products in table transactions. The analyst wants to return the first item in the array for each row. The data analyst is using the following incomplete command: Which lines of code should the data analyst use to fill in the blank in the above code block so that it successfully completes the task?

Options

  • Aproducts.1
  • Cproducts[0]
  • Dproducts[1]

Explanation

Option C (products[0]) is correct because arrays in most query languages (BigQuery, Python, JavaScript, etc.) use zero-based indexing, meaning the first element is at index 0, accessed with bracket notation [0].

Why the distractors are wrong:

  • A (products.1) - Dot notation with a number is not valid syntax for array indexing in SQL or most data platforms; dot notation is used for struct/object fields, not array positions.
  • D (products[1]) - This accesses the second element (index 1), not the first, due to zero-based indexing.

Memory tip: Think of arrays like numbered floors in a building where the ground floor is Floor 0 - the first floor you enter is index [0], not [1]. "Zero is where you begin."

Community Discussion

No community discussion yet for this question.

Full CERTIFIED-DATA-ANALYST-ASSOCIATE PracticeBrowse All CERTIFIED-DATA-ANALYST-ASSOCIATE Questions