Exam SnowPro Core All QuestionsBrowse all questions from this exam
Question 590

Which SQL commands should be used to write a recursive query if the number of levels is unknown? (Choose two.)

    Correct Answer: A, E

    To write a recursive query in SQL when the number of levels is unknown, you should use the commands that support hierarchical or recursive queries. 'CONNECT BY' is used in hierarchical queries to traverse tree-structured data, and 'WITH' is used for Common Table Expressions (CTEs), which can define recursive queries. These two commands are appropriate for handling recursive queries effectively.

Discussion
MultiCloudIronManOptions: AE

CONNECT BY , the recursive CTE portion of the WITH command , Working with CTEs (Common Table Expressions) , Tabular SQL UDFs (UDTFs)

learner2023Options: AE

AE is the correct answer. https://docs.snowflake.com/en/user-guide/queries-hierarchical