Re: [HACKERS] "DML"...CREATE ACRONYM statement - Mailing list pgsql-hackers
From | Thomas Good |
---|---|
Subject | Re: [HACKERS] "DML"...CREATE ACRONYM statement |
Date | |
Msg-id | Pine.LNX.3.96.990612081721.4337A-100000@mailhost.nrnet.org Whole thread Raw |
List | pgsql-hackers |
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 */
pgsql-hackers by date: