On Thursday, 30 January, 2020 12:20, Simon Slavin <slav...@bigfraud.org> wrote:

>I would appreciate your help.  Reading a technical article today, I came
>across a casual reference to "Standard SQL" as if it was a well-known
>thing.  This worried me since I've never heard the term and I'm meant to
>know about such things.

I would say that "Standard SQL" is that variant of SQL is that "minimal common 
subset" dialect of SQL that is understood by every single implementation 
claiming to be "SQL compliant" that has ever existed until the present.  In 
other words, it is the dialect of SQL that will be understood by *any* software 
claiming to be "SQL compliant".

>It doesn't seem to refer to the official standard for SQL, which is huge
>and contains a plethora of features implemented once or never.  The
>author seemed to think it was a sort of 'core SQL' – features identically
>implemented by all, or most, of the well-known SQL engines.

There is a core SQL.  It is not defined.  Most SQL (particularly DDL) is 
"implementation specific".  About the only things that comprise "standard SQL" 
are the DML constructs:

INSERT INTO <table> (<column list>) VALUES (<value list>);
SELECT <column list> FROM <table list> [WHERE <condition>] [GROUP BY <column 
list> [HAVING <having list>]] [ORDER BY <ordering list>]
DELETE FROM <table> [WHERE <condition>]
UPDATE <table> SET <column> = <value>[, <column> = <value>]... [WHERE 

>The one possibility I can think of is SQL:1999.  This is the first
>version which has features marked as 'mandatory' or 'optional'.  A full
>implementation of all mandatory features could, I suppose, be called
>"Standard SQL", but I've never heard of that term being used for that.

This is very Johnny-lately.  I think the first standard was SQL-85 but even 
that was chock full of vendor implementation specifics and light on being 
"standard".  Subsequent versions of the SQL Standard committee output simply 
became more a practice in documenting vendor implementation specifics rather 
than defining a standard.  Most standards suffer from this problem.

>Have any of you been using this term for a meaning other than "Fully
>conforming to SQL:2019 (or whatever version you think current) ?  Do you
>have documentation somewhere ?  Or are my suspicions correct and there's
>no such thing ?

Yes. "standard SQL" is that subset of SQL that is understood by every 
implemetation ever without making changes.  It is a very small subset of the 
language.  Any "standard SQL" statement will operate the same way on every "SQL 
compliant" bit of software that ever existed or will exist in the future.

No.  It comes from experience using more than one SQL language implementation.

No.  THere is most assuredly a "standard SQL" that is understood by every 
implemetation of SQL that ever existed or even will exist.  That it is not 
documented is entirely beside the point.

The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume. 

sqlite-users mailing list

Reply via email to