> SELECT come first makes sense to me because it's the only part of the statement that's required.
Only *IN SQL*.
You don't need it on the relational model, heck, no even in any other paradigm:
1
That is!. (aka: SELECT 1)
So this:
SELECT * FROM foo
is because SQL is made weird. More correctly, this should be only:
foo
Also, SELECT is not required all the time, you wanna do:
foo WHERE .id = 1
foo ORDER BY .id
foo ORDER BY .id WHERE .id = 1 //Note this is not valid in SQL, but because SQL is wrong!
But you probably think this as weird, because SQL in his peculiar implementation, that is, ok for one-off, ad-hoc query, and in THAT case, having the list of fields first is not that bad.
But now, when you see it this way, you note how MUCH nicer and simpler it could have been, because then each "fragment" of a SQL query could become *composable*.
But not on SQL, where the only "composition" is string concatenation, that is bad as you get.
Only *IN SQL*.
You don't need it on the relational model, heck, no even in any other paradigm:
That is!. (aka: SELECT 1)So this:
is because SQL is made weird. More correctly, this should be only: Also, SELECT is not required all the time, you wanna do: But you probably think this as weird, because SQL in his peculiar implementation, that is, ok for one-off, ad-hoc query, and in THAT case, having the list of fields first is not that bad.But now, when you see it this way, you note how MUCH nicer and simpler it could have been, because then each "fragment" of a SQL query could become *composable*.
But not on SQL, where the only "composition" is string concatenation, that is bad as you get.