ExamGecko
Question list
Search
Search

Question 693 - COF-C02 discussion

Report
Export

Which function is used to unload a relational table into a JSON file*?

A.
PARSE_JSON
Answers
A.
PARSE_JSON
B.
JSON_EXTRACT_PATH_TEXT
Answers
B.
JSON_EXTRACT_PATH_TEXT
C.
OBJECT_CONSTRUCT
Answers
C.
OBJECT_CONSTRUCT
D.
TO_JSON
Answers
D.
TO_JSON
Suggested answer: D

Explanation:

The TO_JSON function in Snowflake is used to convert a relational table or individual rows into JSON format. This function is helpful for exporting data in JSON format.

Using TO_JSON Function:

SELECT TO_JSON(OBJECT_CONSTRUCT(*))

FROM my_table;

Exporting Data: The TO_JSON function converts the table rows into JSON format, which can then be exported to a file.

References:

Snowflake Documentation: TO_JSON Function

Snowflake Documentation: Exporting Data

asked 23/09/2024
Maxime SELLY
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first