exam questions

Exam SnowPro Core All Questions

View all questions & answers for the SnowPro Core exam

Exam SnowPro Core topic 1 question 1303 discussion

Actual exam question from Snowflake's SnowPro Core
Question #: 1303
Topic #: 1
[All SnowPro Core Questions]

What is the recommended way to insert a VARIANT value into a Snowflake table?

  • A. Use a SELECT statement to convert data to a VARIANT data type before inserting it.
  • B. Use the TO_VARIANT function in the INSERT statement.
  • C. Cast the data to a VARIANT data type within the INSERT statement.
  • D. Use a subquery to convert the data to a VARIANT data type and then insert it.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
37ceea2
2 months, 2 weeks ago
Selected Answer: A
I have analyzed more on the info from my previous email. My answer is A.
upvoted 1 times
...
37ceea2
2 months, 2 weeks ago
Selected Answer: D
https://docs.snowflake.com/en/sql-reference/functions/to_variant "The TO_VARIANT function cannot be used directly in an INSERT statement. Instead, use INSERT INTO ... SELECT.... Hence, ANSWER B is not correct. As per the right answer, or A, or D. I am saying D, only because I have to select an answer. Please, see below syntax, for JSON: INSERT INTO to_variant_example (v_varchar, v_number, v_timestamp, v_array, v_object) SELECT TO_VARIANT('Skiing is fun!'), TO_VARIANT(3.14), TO_VARIANT('2024-01-25 01:02:03'), TO_VARIANT(ARRAY_CONSTRUCT('San Mateo', 'Seattle', 'Berlin')), PARSE_JSON(' { "key1": "value1", "key2": "value2" } '); SELECT * FROM to_variant_example; Not very confident that this will help here.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago