SnowPro Core Certification — Question 956
Which function is used to convert rows in a relational table to a single VARIANT column?
Answer options
- A. ARRAY_AGG
- B. OBJECT_AGG
- C. ARRAY_CONSTRUCT
- D. OBJECT_CONSTRUCT
Correct answer: D
Explanation
The correct answer is D, OBJECT_CONSTRUCT, which is specifically designed to create an object from the rows of a relational table into a VARIANT column. Options A and B, ARRAY_AGG and OBJECT_AGG, are used for aggregating data into arrays or objects, respectively, but do not convert rows into a VARIANT column in the same manner as OBJECT_CONSTRUCT. Option C, ARRAY_CONSTRUCT, creates an array but does not achieve the desired transformation of rows into a single VARIANT column.