Correlated vs. non-correlated subqueries: differences, performance, and when to use each in analytical SQL
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks you to explain how correlated and non-correlated SQL subqueries differ and what each costs at query time. Tests understanding of per-row evaluation, optimizer rewrites into semi-joins, window function alternatives, and which form to choose for existence checks, thresholds and per-group metrics.