Lesson 1 / 37 · How a query runs

Written order is not execution order

You write SELECT first, but the database runs it last. Watch the step numbers in the editor gutter: FROM is 01, WHERE is 02, SELECT is 03. Every lesson from here on follows that order.

The query

SELECT name, country
FROM customers
WHERE country = 'US'

Try SELECT name alone: WHERE still tests country, because it runs before SELECT drops the column.

Next: An alias exists only after SELECT · All lessons