Lambda the Ultimate

inactiveTopic SQL for Smarties
started 1/15/2001; 12:53:39 PM - last post 1/16/2001; 1:39:19 AM
Ehud Lamm - SQL for Smarties  blueArrow
1/15/2001; 12:53:39 PM (reads: 523, responses: 2)
SQL for Smarties
That's the title of Joe Celko's book (and series of articles). It is debatable whether SQL is a programming language, but it is evident that many programmers program in SQL...

Celko gives puzzles and interesting tricks.
Posted to "" by Ehud Lamm on 1/15/01; 12:53:53 PM

Chris Rathman - Re: SQL for Smarties  blueArrow
1/15/2001; 2:03:17 PM (reads: 549, responses: 0)
It is debatable whether SQL is a programming language, but it is evident that many programmers program in SQL...
Although I'd agree that ANSI-SQL is not a programming language (It's not Turing complete)...

I do think that the stored procedure facilities (PL-SQL for Oracle, T-SQL for MS & Sybase SQLServer, and PL/PGSQL for PostgreSQL) do qualify as programming languages. Indeed, I wish the vendors would just flat out acknowledge them as programming languages and start giving us the functionality, extensibility and syntax that one expects from most other general purpose languages.

At the other end of programming, most languages that support SQL statements do so through the use of strings. This means that other than making sure the strings are properly formed, there is no compile time checking for the resulting queries. Being as queries form an integral part of the programs function - at least for DB intensive applications, it's odd that we still insist on runtime evaluation of SQL expressions.

Just as an aside, there's a introductory book on PostgreSQL available on the web for those interested in that server.

Ehud Lamm - Re: SQL for Smarties  blueArrow
1/16/2001; 1:39:19 AM (reads: 532, responses: 0)
Some databases allow you to write SP in any language, or using a general purpose langugae (doesn't DB2 accept Java? Adabas support Natural).

Databases that support 'static binding' do create the access paths during the bind phase, done as part of the compilation process. So SQL checking is done in advance.