On 2/10/22 10:33 PM, Raymond Brinzer wrote:
[snip]
Here's one that I think is simple: why would we want a language where the
clauses must come in a particular order? `FROM mytable SELECT column` is
as clear an expression as `SELECT column FROM mytable`, and probably
better, in that it starts with the source and winnows from there.
Likewise, the order of WHERE, ORDER BY, and so on don't change what is
being said.
I believe the "why" is, "because parsing SQL is hard enough already", but
that's a problem unto itself. A language with a more regular syntax is
easier to work with and improve.
The answer is obvious to every grey beard: SQL was developed from SEQUEL,
Structured *ENGLISH* Query Language at a company that loved English-style
programming languages.
"SELECT column FROM mytable WHERE condition" is a perfect declarative
English sentence that any middle school grammar teacher would be proud of.
"FROM mytable SELECT column"... not so much.
--
Angular momentum makes the world go 'round.