r/SQL • • Jun 15 '26

MySQL SQL Correlated Subqueries

Hey everyone, I’m about a week into learning SQL (doing a Data Analyst track) and I’ve officially hit my first major wall at data manipulation.

Regular subqueries make sense, but correlated subqueries are completely tripping me up.

Could anyone explain:

  • How they actually work under the hood?
  • Why they are different from non-correlated ones?
  • What we actually use them for, and are they basically just another version of a self-join?

Any simple analogies or step-by-step breakdowns would be massively appreciated. Thanks!

1 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/foxsimile Jun 18 '26

From my experience, at times the query planner can vary based on the fucking indentation it seems.