
Answer-first summary for fast verification
Answer: Both of the above
The FLATTEN function in Snowflake is used to query both structured and semi-structured data. According to Snowflake documentation and the community discussion with higher upvotes and detailed reasoning, FLATTEN works with structured types (structured ARRAY, structured OBJECT, and MAP values) to convert nested structures into a relational format, as well as with semi-structured data types (VARIANT, OBJECT, ARRAY) to expand them for querying. While some comments suggest only semi-structured data (B), the official documentation and the consensus in the discussion (including comments with upvotes and references to docs) support that FLATTEN applies to both, making C the correct answer. Options A and D are incorrect because FLATTEN is not limited to just structured data or none of the types.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.