This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Data manipulation language" – news ·newspapers ·books ·scholar ·JSTOR(June 2009) (Learn how and when to remove this message) |
Adata manipulation language (DML) is a computerprogramming language used for adding (inserting), deleting, and modifying (updating) data in adatabase. A DML is often asublanguage of a broaderdatabase language such asSQL, with the DML comprising some of the operators in the language.[1] Read-only selecting of data is sometimes distinguished as being part of a separatedata query language (DQL), but it is closely related and sometimes also considered a component of a DML; some operators may perform both selecting (reading) and writing.
A popular data manipulation language is that ofStructured Query Language (SQL), which is used to retrieve and manipulatedata in arelational database.[2] Other forms of DML are those used byIMS/DLI,CODASYL databases, such asIDMS and others.
In SQL, the data manipulation language comprises theSQL-data change statements,[3] which modify stored data but not theschema or database objects. Manipulation of persistent database objects, e.g., tables orstored procedures, via the SQL schema statements,[3] rather than the data stored within them, is considered to be part of a separatedata definition language (DDL). In SQL these two categories are similar in their detailed syntax, data types, expressions etc., but distinct in their overall function.[3]
TheSQL-data change statements are a subset of theSQL-data statements; this also contains theSELECT query statement,[3] which strictly speaking is part of the DQL, not the DML. In common practice though, this distinction is not made andSELECT is widely considered to be part of DML,[4] so the DML consists of allSQL-data statements, not only theSQL-data change statements. TheSELECT ... INTO ... form combines both selection and manipulation, and thus is strictly considered to be DML because it manipulates (i.e. modifies) data.
Data manipulation languages have their functional capability organized by the initial word in a statement, which is almost always averb. In the case of SQL, these verbs are:
SELECT ... FROM ... WHERE ... (strictly speaking DQL)INSERT INTO ... VALUES ...UPDATE ... SET ... WHERE ...DELETE FROM ... WHERE ...For example, the command to insert a row into tableemployees:
INSERTINTOemployees(first_name,last_name,fname)VALUES('John','Capita','xcapit00');
Most SQL database implementations extend their SQL capabilities by providingimperative, i.e. procedural languages. Examples of these areOracle'sPL/SQL andIBM Db2'sSQL_PL.
Data manipulation languages tend to have many different flavors and capabilities between database vendors. There have been a number of standards established for SQL byANSI,[2] but vendors still provide their own extensions to the standard while not implementing the entire standard.
Data manipulation languages are divided into two types,procedural programming anddeclarative programming.
Data manipulation languages were initially only used withincomputer programs, but with the advent of SQL have come to be used interactively by database administrators.
Data manipulation language (DML) statementsquery or manipulate data in existing schema objects.