
Answer-first summary for fast verification
Answer: OBJECT_CONSTRUCT
The question asks which function can be used with the COPY command to unload a relational table into a JSON file. OBJECT_CONSTRUCT (C) is the correct answer because it creates JSON objects from relational data, making it suitable for converting table rows into JSON format during unloading. The community discussion shows strong consensus for C with 86% of users selecting it and multiple comments confirming it as correct. While FLATTEN (A) was mentioned by one commenter for converting semi-structured data to relational format, this is the opposite of what's needed - we need to convert relational data to JSON format, not the reverse. LISTAGG (B) concatenates values into strings, not JSON objects. PARSE_JSON (D) parses JSON strings into VARIANT data, which is for loading JSON, not unloading relational data to JSON.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.