exam questions

Exam SnowPro Core All Questions

View all questions & answers for the SnowPro Core exam

Exam SnowPro Core topic 1 question 89 discussion

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

The FLATTEN function is used to query which type of data in Snowflake?

  • A. Structured data
  • B. Semi-structured data
  • C. Both of the above
  • D. None of the above
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
francisss
5 months, 1 week ago
Selected Answer: C
* Why is FLATTEN also used in Structured Types? : Because Snowflake's Structured Types (structured data) have internally nested complex structures, they are difficult to query directly using general SQL queries. : At this time, the FLATTEN function performs the following roles: - Convert nested structures into table form for easy search. - Internal composite elements (STRUCTURED ARRAY, STRUCTURED OBJECT, MAP internal elements) are expanded into separate rows to enable querying. In other words, the FLATTEN function is essential in Snowflake's Structured Types (explicitly structured complex data), not general table data.
upvoted 1 times
...
francisss
5 months, 1 week ago
Selected Answer: C
there are 2 reason in snowflake document. 1) https://docs.snowflake.com/en/sql-reference/data-types-structured#label-structured-types-working-flatten --> Using the FLATTEN function with values of structured types --> You can pass structured ARRAY, structured OBJECT, and MAP values to the FLATTEN function. As is the case with semi-structured data types, you can use the PATH argument to specify the value being flattened. 2) https://docs.snowflake.com/en/sql-reference/functions/flatten#usage-notes --> FLATTEN is a table function that takes a VARIANT, OBJECT, or ARRAY column and produces a lateral view (i.e. an inline view that contains correlation referring to other tables that precede it in the FROM clause). --> FLATTEN can be used to convert semi-structured data to a relational representation.
upvoted 1 times
...
someshVashistha
7 months ago
Selected Answer: B
Answer B The FLATTEN function in Snowflake is used to query and extract data from semi-structured data types, specifically: Arrays Objects (key-value pairs, such as those found in JSON data) The function expands these structures into a table-like format, allowing you to work with individual elements or key-value pairs in SQL queries.
upvoted 1 times
...
MohamedBen
8 months, 1 week ago
Selected Answer: B
Answer B
upvoted 1 times
...
DataEngineerNeeraj1
10 months ago
Selected Answer: C
C
upvoted 1 times
...
aemilka
11 months ago
Selected Answer: C
You can pass structured ARRAYs, structured OBJECTs, and MAPs to the FLATTEN function. https://docs.snowflake.com/en/sql-reference/data-types-structured#label-structured-types-working-flatten FLATTEN can be used to convert semi-structured data to a relational representation. https://docs.snowflake.com/en/sql-reference/functions/flatten So the answer is C. Both of the above
upvoted 2 times
...
omiiUST
1 year ago
Selected Answer: A
The main purpose of FLATTEN is to Un-nest the semistructured data like JSON.
upvoted 1 times
...
Mallikharjuna452
1 year ago
It works for both
upvoted 1 times
...
372110c
1 year, 1 month ago
Selected Answer: C
Works with both
upvoted 2 times
...
MBrat
1 year, 2 months ago
Selected Answer: C
C is correct, see https://docs.snowflake.com/en/sql-reference/data-types-structured#label-structured-types-working-flatten
upvoted 3 times
...
MultiCloudIronMan
2 years ago
Selected Answer: B
Correct
upvoted 1 times
...
Mayuri917233
2 years, 2 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
Tapasgup007
2 years, 7 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
lhstudylh
3 years, 5 months ago
Selected Answer: B
Correct answer FLATTEN is used to unnest semi-structured data. Don't see an application for structured data as by definition it shouldn't be nested.
upvoted 3 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 ...