From: priya1 on
What are the advantages os SQL over third generation Language?

From: Mikito Harakiri on
priya1 wrote:
> What are the advantages os SQL over third generation Language?

Here are couple of paragraphs from preface of my advanced SQL
programming book (due in may):

<quote>
SQL is a very successful language. This might be surprising to a
newcomer who generally find SQL a little bit old fashioned compared to
"modern" programming languages. It's almost as old as COBOL and it
looks like FORTRAN, why isn't it obsolete yet? Let assure the reader
that this appearance is misleading. Under the cover of sloppy and
archaic syntax we find a high abstraction language.

SQL programming is very unusual from procedural perspective: there is
no explicit flow control, no loops, and no variables either to apply
operations to, or to store intermediate results into. SQL heavily
leverages predicates instead, which elevates it to Logic Programming.
Then, grouping and aggregation syntax blend naturally into this already
formidable logic foundation. Anybody who rediscovers that matrix or
polynomial multiplication can be written in just three lines of code
has a long lasting impression.
</quote>

From: Oliver Wong on

"Mikito Harakiri" <mikharakiri_nospaum(a)yahoo.com> wrote in message
news:1136914920.473116.225150(a)g47g2000cwa.googlegroups.com...
> priya1 wrote:
>> What are the advantages os SQL over third generation Language?
>
> Here are couple of paragraphs from preface of my advanced SQL
> programming book (due in may):
>
> <quote>
> SQL is a very successful language. This might be surprising to a
> newcomer who generally find SQL a little bit old fashioned compared to
> "modern" programming languages. It's almost as old as COBOL and it
> looks like FORTRAN, why isn't it obsolete yet? Let assure the reader
> that this appearance is misleading. Under the cover of sloppy and
> archaic syntax we find a high abstraction language.
>
> SQL programming is very unusual from procedural perspective: there is
> no explicit flow control, no loops, and no variables either to apply
> operations to, or to store intermediate results into. SQL heavily
> leverages predicates instead, which elevates it to Logic Programming.
> Then, grouping and aggregation syntax blend naturally into this already
> formidable logic foundation. Anybody who rediscovers that matrix or
> polynomial multiplication can be written in just three lines of code
> has a long lasting impression.
> </quote>
>

I thought SQL was a declarative language, in the sense that you say what
you want, not how to get what you want, and the engine takes care of
figuring out the optimal implementation for filling your request.

Is SQL a Turing Complete language?

- Oliver


From: Mikito Harakiri on
Oliver Wong wrote:
> I thought SQL was a declarative language, in the sense that you say what
> you want, not how to get what you want, and the engine takes care of
> figuring out the optimal implementation for filling your request.

This is correct. It doesn't contradict to what I wrote, however.

> Is SQL a Turing Complete language?

Depends what features are allowed. Basic relational algebra enhanced
with subqueries agregation and grouping (which is considered core SQL)
is not Turing complete. With recursion it is. ANSI standard SQL is
overwhelmed with features, there are even spreadsheet kind of
extensions which introduce intermediate variables. Many people consider
those procedural looking extensions as ugly.

From: topmind on

Mikito Harakiri wrote:
> priya1 wrote:
> > What are the advantages os SQL over third generation Language?
>
> Here are couple of paragraphs from preface of my advanced SQL
> programming book (due in may):
>
> <quote>
> SQL is a very successful language. This might be surprising to a
> newcomer who generally find SQL a little bit old fashioned compared to
> "modern" programming languages. It's almost as old as COBOL and it
> looks like FORTRAN,


SQL is about 15 years younger than COBOL, so "almost as old" is
misleading. FORTRAN? I think SQL looks more like COBOL than FORTRAN.

Take that book back now; don't wait for May :-)


> why isn't it obsolete yet? Let assure the reader
> that this appearance is misleading. Under the cover of sloppy and
> archaic syntax we find a high abstraction language.


What I don't get is why other relational languages don't make a run at
SQL? The only serious attempt is from the Date group (Tutorial D). (I
have also drafted a relational language myself, tentatively called
SMEQL.)

People make a jillion procedural and OOP languages, but there are only
2 or so SQL competitors, and they are in draft mode for the most part.
Why the big diff?

>
> SQL programming is very unusual from procedural perspective: there is
> no explicit flow control, no loops, and no variables either to apply
> operations to, or to store intermediate results into. SQL heavily
> leverages predicates instead, which elevates it to Logic Programming.
> Then, grouping and aggregation syntax blend naturally into this already
> formidable logic foundation. Anybody who rediscovers that matrix or
> polynomial multiplication can be written in just three lines of code
> has a long lasting impression.
> </quote>

-T-