I pretty much always start typing SQL queries with “SELECT *” because I know I’ll come back and figure that part out later.
It’s similar to how I write Python list comprehensions. I almost always type “x for x in” from muscle memory, then get the collection part at the end correct, then go back and fix the beginning. My brain just won’t think in the other direction.
Oh yeah I agree - the forward reference to attributes before the source is stated does feel backwards when writing the expression.
Compare scala's for-comprehension that feels more natural: `for (x <- xs) yield x + 1;`
Perhaps there's an argument that the shape of the result is defined up front, so it might be easier to comprehend the result if not the implementation.
If you type just a table name into an empty cell it will autocomplete with a full SELECT statement. e.g. if you typed "pubuser" and selected "public.users" it would autocomplete with:
SELECT pu.*
FROM public.users AS pu
WHERE 1=1
It will even take a stab at aliasing the table for you.
It’s similar to how I write Python list comprehensions. I almost always type “x for x in” from muscle memory, then get the collection part at the end correct, then go back and fix the beginning. My brain just won’t think in the other direction.