
Answer-first summary for fast verification
Answer: TO_JSON
The question asks which function is used to unload a relational table into a JSON file. TO_JSON (D) is the correct answer because it converts relational data into a JSON-formatted string, which is essential for exporting to a JSON file. This is supported by the community discussion where D has the highest percentage (71%) and upvoted comments explain that TO_JSON serializes data into JSON representation. OBJECT_CONSTRUCT (C) creates a JSON object but does not directly convert the entire relational table into a JSON string suitable for unloading; it requires additional steps like COPY INTO. PARSE_JSON (A) and JSON_EXTRACT_PATH_TEXT (B) are for parsing or extracting from JSON, not converting relational data to JSON.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.