Joe Celko's SQL for Smarties: Advanced SQL Programming, Third Edition

The good news about SQL is that the programmer only needs to learn the SELECT statement to do almost all his work. The bad news is that the statement can have so many nested clauses that it looks like a Victorian novel! The SELECT statement is used to query the database. It combines one or more tables, can do some calculations, and finally puts the results into a result table that can be passed on to the host language.
I have not spent much time on the simple one-table SELECT statements you see in introductory books. I am assuming that the readers are experienced SQL programmers and got enough of those queries when they were learning SQL.
There is an order to the execution of the clauses of an SQL SELECT statement that does not seem to be covered in most beginning SQL books. It explains why some things work in SQL and others do not.
The simplest possible SELECT statement is just " SELECT * FROM Sometable;" which returns the entire table as it stands. You can actually write this as " TABLE Sometable" in Standard SQL, but nobody seems to use that syntax. Though the syntax rules say that all you need are the SELECT and FROM clauses, in practice there is almost always a WHERE clause.
Let's look...