In essence, (and in order)

select columnexprs..

from source

join sources..

where rowfilters..

group by rowgroupers..

having groupfilters..

order by columnexprs..

limit ..