databites

databites

Visual Bites

Mastering SQL Execution Order with JOINs

Mastering SQL Execution Order: How Queries Really Run Behind the Scenes

Josep Ferrer's avatar
Josep Ferrer
Jun 07, 2026
∙ Paid

Last week we broke down SQL’s execution order: your clauses don’t run in the order you write them. FROM first, SELECT fifth.

You write SELECT first. SQL runs it fifth.

You write SELECT first. SQL runs it fifth.

Josep Ferrer
·
May 31
Read full story

With one table, that’s easy to hold in your head. Add a JOIN, and one question trips up almost everyone: when you combine two tables and then filter them, what runs first?

The JOIN. It builds the combined table before any filter tou…

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2026 Josep Ferrer · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture