What is the execution sequence when a query has CTEs, window functions, and GROUP BY?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks for the logical order in which SQL evaluates CTEs, WHERE, GROUP BY, HAVING, window functions, ORDER BY and LIMIT. Tests whether you can predict what rows a window function sees, why you cannot filter on it in WHERE, and how logical order differs from the executed plan.