OA. free
Free
Ukg Data Structures & Algorithms Data Structures & Algorithms Medium

Pick ONE option

Ukg technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Pick ONE option**

Choose one option.
Show answer & explanation
Answer: A. Choose the statement that is not correct.

In SQL, recursive Common Table Expressions (CTEs) generally prohibit the use of aggregate functions, window functions, or DISTINCT in the recursive member. Furthermore, the claim that the recursive part is 'much faster' due to optimization is technically incorrect; recursive processing is typically more computationally expensive than the initial anchor member.

Step-by-step Derivation:
Step 1: Analyze the provided images to identify the specific question being asked. The user is asking for the 'statement that is not correct' regarding recursive CTEs (Question 19 in the final set of images).
Step 2: Evaluate the options provided in the image:

  • 'A CTE can be self-referencing (recursive)': This is correct by definition of a recursive CTE.
  • 'The WITH clause must begin with WITH RECURSIVE if any CTE in the WITH clause refers to itself': This is correct for standard SQL (PostgreSQL, MySQL 8.0+).
  • 'The recursive SELECT part in a recursive CTE with aggregate or window functions is much faster...': This is incorrect. Most SQL dialects explicitly forbid aggregate or window functions within the recursive member of a CTE to prevent infinite loops or undefined behavior. Even if supported in specific edge cases, there is no general optimization that makes the recursive part 'much faster' than the anchor part.
    Step 3: Conclusion: Option A is the incorrect statement.