Thread: Re: [HACKERS] "DML"...CREATE ACRONYM statement

Re: [HACKERS] "DML"...CREATE ACRONYM statement

From
Thomas Good
Date:
On Sat, 12 Jun 1999, Hannu Krosing wrote:

> But what would you call yer query when the tables have rules/triggers
> attached that do alter data ? A DML-savvy QUERY ;)
> 
> BTW, where do all the triggers and rules fall anyway, or ar they a
> different subset - maybe Data Behaviour Language (DBL)

Right.  Well, in the interests of annoying Tom Lockhart further...
I've attempted to define SQL and its subsets.  Preliminary apologies
are apprently offered to Thomas, Hannu, Don, D'Arcy and Vadim (who
seems to be cc'd on this foolishness).

Here 'tis:

Conversational SQL - A Gratuitous Glossary
------------------------------------------

It would appear that one could blame E. F. ('Ted') Codd for
the current state of confusion regarding the various subsets
(DML-DDL-DCL-Queries, et al.) of the SQL language.  Of course,
he is probably not responsible...in any event:

In June, 1970 Codd presented a paper on 'A Relational Model of
Data For Large Shared Data Banks.'  This act set in motion
a chain reaction the result of which was the preeminence of
relational databases and their primary interface - the language
known as `SQL'.  It also set in motion the entire process of
developing acronyms to help with the obfuscation of any remaining
points of clarity surrounding the language whose very name is 
the subject of controversy.  (The fact that a language which does 
not have a procedural nature is termed `structured' is an apparently 
oxymoronic bit of wordplay along the lines of `English Grammar.')

The original query language that accompanied IBM's System R database
was known as SEQUEL  (Structured English QUEry Language).  IBM
is often blamed for later truncating the name to SQL.  In any case,
SQL (pronounced either as sequel or S-Q-L) stuck.  At some point
in the birthing process, SQL was either carved up into subsets
or perhaps borne of the concatenation of various subsets which may
or may not have existed within the vernacular of SQL's mischeivous
midwives.

The various subsets are the source of much confusion, apparently 
by design.  Although this point is also open to disputation.

The subsets would seem to be (and these are widely disputed and 
misrepresented, especially by this writer):

The QUERY:  the basic building block of SQL.  The SELECT statement
is the quintessential QUERY.  Except, as was pointed out by Hannu
Krossing, when the SELECT accesses a TABLE that has rules or triggers
attached...in this instance (and probably others as well) the SELECT
comes dangerously close to DML (a notorious subset covered below).
However, this is probably an inaccurate definition as rules, triggers
and stored procecures are not actually part of core SQL, if there
is such a thing.  What are they?  Procedural Extensions...

Moving along nicely now we come to Data Manipulation Language, another
subset of SQL which alleges to provide some functionality whilst defying
definition.  DML, as it is known, is composed of INSERT INTO, UPDATE
and DELETE FROM statements.  DML manipulates data unlike SELECT QUERIES
which manipulate data.  The difference apparently is that DML can alter
data, while SELECT cannot unless the table it is querying has procedural
extensions somehow glued to it.  Or if it is part of an DML statement as
in an INSERT INTO y SELECT * FROM x;  statement or a CREATE TABLE AS SELECT
statement.  Although there is tremendous overlap here we cling to this
arbitary cutting up in the interests of clarity.

The next subset would seem to be DDL.  Data Definition Language appears to
govern the creation and destruction of database objects.  It includes
CREATE TABLE, CREATE SEQUENCE, CREATE INDEX and similar statements.  It 
also includes the destructive counterparts:  DROP TABLE and so on.
Unfortunately DROP ACRONYM is apparently not implemented.  As DDL seems
to be clearly defined by comparison with DML and SELECT queries it is
perhaps time to introduce some ambiguity.

DCL (Data Control Language) may or may not exist.  It may or may not be
a part of DDL, depending on which erudite text one reads.  It may also be
colloquially termed `data administration language' or something similar.
Perhaps not.  In any case it seems to contain the GRANT and REVOKE 
statements which offer the illusion of control in a language which is 
obviously out of control.

EOT!
-------------------------------------
Tom Good, New York City, 12 June 1999

------- North Richmond Community Mental Health Center -------

Thomas Good                                   MIS Coordinator
Vital Signs:                  tomg@ { admin | q8 } .nrnet.org                                         Phone:
718-354-5528                                          Fax:   718-354-5056                               
 
/* Member: Computer Professionals For Social Responsibility */ 



Re: [HACKERS] "DML"...CREATE ACRONYM statement

From
Thomas Lockhart
Date:
I like it! :)

Of course, if I include it in the docs then it would be much more
effective if I also include the previous 20 mail messages on the
subject...
                  - Thomas

-- 
Thomas Lockhart                lockhart@alumni.caltech.edu
South Pasadena, California


Re: [HACKERS] "DML"...CREATE ACRONYM statement

From
Thomas Good
Date:
On Sat, 12 Jun 1999, Thomas Lockhart wrote:

> I like it! :)
> 
> Of course, if I include it in the docs then it would be much more
> effective if I also include the previous 20 mail messages on the
> subject...
> 
>                    - Thomas

Ok...ok!  I sheared off abit of the fluff and here it is...provided
it meets with everyone's approval you're free to do with it what you
will.

Cheers,
Tom

-------------------------------------------------------------

SQL subsets - QUERIES, DML, DDL and DCL
---------------------------------------

The original query language that accompanied IBM's System R database
was known as SEQUEL  (Structured English QUEry Language).  IBM
later truncated the name to SQL - pronounced either as sequel 
or as the phonetic eS-Que-eL.  SQL has one basic operation and
3 subsets:

The QUERY - SQL has one primordial operation known as a QUERY.  
'SELECT' is the verb in the basic SQL query.  Queries can become rather
complex and may include elements of DML (Data Manipulation Language).
Queries may also access tables that contain TRIGGERs and RULEs
thus invoking more complex database operations.  In its most elemental
form, however, a SELECT statement is a simple QUERY.

DML - the Data Manipulation Languge subset of SQL - is composed of 
INSERT INTO, UPDATE and DELETE FROM statements.  DML manipulates data
(altering it) while SELECT, at least in its purest form, does not.

DDL - the Data Definition Language subset of SQL - is a collection of
statements that create and destroy database objects.  It includes
CREATE TABLE, CREATE SEQUENCE, CREATE INDEX and similar statements.  It 
also includes the destructive counterparts:  DROP TABLE and so on.
(Unfortunately DROP ACRONYM is apparently yet to be implemented.)

DCL - the Data Control Language subset of SQL - is that part of the SQL
language that controls user access.  It contains the GRANT and REVOKE 
statements which govern permissions.

------- North Richmond Community Mental Health Center -------

Thomas Good                                   MIS Coordinator
Vital Signs:                  tomg@ { admin | q8 } .nrnet.org                                         Phone:
718-354-5528                                          Fax:   718-354-5056                               
 
/* Member: Computer Professionals For Social Responsibility */ 


------- North Richmond Community Mental Health Center -------

Thomas Good                                   MIS Coordinator
Vital Signs:                  tomg@ { admin | q8 } .nrnet.org                                         Phone:
718-354-5528                                          Fax:   718-354-5056                               
 
/* Member: Computer Professionals For Social Responsibility */