Question

I understand that DML technically encompasses SQL verbs which merely query but do not modify persistent data. (See, e.g., wikipedia or oracle or orafaq)

However, I often wish to refer to "all and only those SQL verbs which modify stored/persistent data" -- basically INSERT, UPDATE, DELETE but not a plain SELECT. Is there an official/standardized term, or, perhaps separately, a cogent and graceful term, for this subset of DML?

Was it helpful?

Solution

I don't think there is one, sadly, from an official perspective. Perhaps we need to make one up?

Personally, I think the term DML is misleading because the term doesn't really describe the way SELECT works, as it (usually) doesn't actually modify anything. It only "collects" the relational data in a different fashion in temporary space and returns a specified set of it.

So, if it was my choice, I would say that:

DML would describe INSERT/UPDATE/DELETE

and

DRL (data retrieval language) would describe SELECT.

OTHER TIPS

DML includes SELECT INTO (as opposed to just SELECT) because it is a synonym for INSERTs. There's no need to subcategorize.

After thinking about it on the way into work, I remembered that SELECT is used for data manipulation. For example:

SELECT t.firstname +' '+ t.lastname --String concatenation
SELECT CAST(t.column AS int) --Datatype change

My professor used to define them as Edits (as opposed to Reads), but I do not know of a Standard Term for IUD.

based on CRUD: Create, read, update and delete, you could just say CUD (create, update, delete). however, I'm not sure if anyone uses that.

According to the Wikipedia article on SQL,

The Data Manipulation Language (DML) is the subset of SQL used to add, update and delete data:

and the statements discussed there (INSERT, UPDATE, DELETE, MERGE, TRUNCATE, etc) are placed in a different category than SELECT.

So, according to Wikipedia, DML may not necessarily include SELECT.


According to the SQL-92 standard, glancing at the table-of-contents reveals that DML does include SELECT INTO:

     13 Data manipulation ............................................371

     (...)

     13.5 <select statement: single row> .............................382

     (...)

The definition listed there describes SELECT <columns> INTO ... .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top