See LINQ. There they had the opportunity to fix it and it works just great.
This nullifies some other common sources of confusion, such as which statements are executed before a GROUP BY and which ones after (and why HAVING exists as a keyword). It's also similar to how CTE syntax is generally much more readable than subqueries.
This declarative property also provides a (somewhat weak) motivation of why SELECT should come first. Precisely because it answers part of the WHAT, i.e., the schema of the result.
However,
SELECT a1,a2,... FROM Table AS t WHERE Condition
is syntactically equivalent to Python list comprehension: [(t.a1,t.a2,...) for t in Table if Condition]
Here the use of attributes (SELECT) is also written before the iterator.SELECT is also analogous to normal loops:
foreach t in Table
if not Condition: continue
# Use t.a1, t.a2 etc.
Here we first provide the loop specification while the usage of elements is written only in the body.So, I will start with a SELECT * FROM myTable t, then go back and replace * with t.<columns appear here>.
I'll use the same in other places in the query like WHERE conditions.
I use DataGrip at work and it can complete the column names without knowing the table name, so it ends up not being a problem.
If the query is simple enough that a natural join would work and you aren't doing FROM clause aliasing (which can be useful to make reusable queries self-documenting), sure.
For more complex queries and obviously any time table or column aliasing are used, that becomes somewhere between less likely and logically impossible.
Ofc that might just be the emphasis on joins makes group by the next lowest hanging fruit
Urban Dictionary (https://www.urbandictionary.com) or even just typing something like "what does tbh mean?" into your preferred search engine will often help you find likely interpretations of unknown abbreviations, in my experience.
I mean, that's what they did.
There is significant problem-solution mismatch in joins and some other SQL constructs which are therefore semantically quite controversial in many use cases:
CREATE FUNCTION fullname(person) RETURNS TEXT AS $$
SELECT $1.firstname || ' ' || $1.lastname
$$ LANGUAGE SQL
Could you go into a more detail wrt using lateral joins with set returning functions? I'm used to using them as a way to "extend" the row with later terms depending on prior terms as you say, but I'm not comprehending the srf case so well (or tbh the results that pop up when I search for "posrgresql set returning function").But for my taste the language is to close to English and therefore redundant and inconsistent in an annoying way. Example:
Select x from tbl ...
Delete from tbl ...
Update tbl set x=...
Why change the word order?
Codd wrote a couple of query languages before, but they apparently weren't usable by mere mortals.
SQL is over 40 years old, and still dominates. The most recent contenders had to position themselves in terms of SQL (NoSQL).
On a related note, I always found the syntax of SQL to be great. Someone told me that simplicity of SQL made relational databases even more popular. It is one of the best designed language where even someone new to the field won't feel intimidated. I'm surprised designers of SQL haven't won the Turing Award yet.