In essence, (and in order)
select columnexprs..
from source
join sources..
where rowfilters..
group by rowgroupers..
having groupfilters..
order by columnexprs..
limit ..
I definitely had Julia Evans’ SQL doodle on the wall behind my monitor for a long, long time. This is more about how it’s written, though, not how it’s run.