Data manipulation language
   HOME

TheInfoList



OR:

A data manipulation language (DML) is a computer
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
used for adding (inserting), deleting, and modifying (updating) data in a
database In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
. A DML is often a sublanguage of a broader database language such as SQL, with the DML comprising some of the operators in the language. Read-only selecting of data is sometimes distinguished as being part of a separate data 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 of Structured Query Language (SQL), which is used to retrieve and manipulate
data Data ( , ) are a collection of discrete or continuous values that convey information, describing the quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpreted for ...
in a
relational database A relational database (RDB) is a database based on the relational model of data, as proposed by E. F. Codd in 1970. A Relational Database Management System (RDBMS) is a type of database management system that stores data in a structured for ...
. SQL92 Other forms of DML are those used by IMS/DLI, CODASYL databases, such as IDMS and others.


SQL

In SQL, the data manipulation language comprises the ''SQL-data change'' statements, which modify stored data but not the
schema Schema may refer to: Science and technology * SCHEMA (bioinformatics), an algorithm used in protein engineering * Schema (genetic algorithms), a set of programs or bit strings that have some genotypic similarity * Schema.org, a web markup vocab ...
or database objects. Manipulation of persistent database objects, e.g., tables or
stored procedure A stored procedure (also termed prc, proc, storp, sproc, StoPro, StoredProc, StoreProc, sp, or SP) is a subroutine available to applications that access a relational database management system (RDBMS). Such procedures are stored in the database d ...
s, via the SQL schema statements, SQL92 4.22.2, SQL statements classified by function rather than the data stored within them, is considered to be part of a separate data definition language (DDL). In SQL these two categories are similar in their detailed syntax, data types, expressions etc., but distinct in their overall function. The ''SQL-data change'' statements are a subset of the ''SQL-data'' statements; this also contains the SELECT query statement, which strictly speaking is part of the DQL, not the DML. In common practice though, this distinction is not made and ''SELECT'' is widely considered to be part of DML, so the DML consists of all ''SQL-data'' statements, not only the ''SQL-data change'' statements. The SELECT ... 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 a
verb A verb is a word that generally conveys an action (''bring'', ''read'', ''walk'', ''run'', ''learn''), an occurrence (''happen'', ''become''), or a state of being (''be'', ''exist'', ''stand''). In the usual description of English, the basic f ...
. In the case of SQL, these verbs are: * SELECT ... FROM ... WHERE ... (strictly speaking DQL) ** SELECT ... INTO ... * INSERT INTO ... VALUES ... * UPDATE ... SET ... WHERE ... * DELETE FROM ... WHERE ... For example, the command to insert a row into table employees: INSERT INTO employees (first_name, last_name, fname) VALUES ('John', 'Capita', 'xcapit00');


Variants

Most SQL database implementations extend their SQL capabilities by providing imperative, i.e. procedural languages. Examples of these are
Oracle An oracle is a person or thing considered to provide insight, wise counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. If done through occultic means, it is a form of divination. Descript ...
's PL/SQL and IBM Db2's SQL_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 by
ANSI The American National Standards Institute (ANSI ) is a private nonprofit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organiz ...
, 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 Procedural programming is a programming paradigm, classified as imperative programming, that involves implementing the behavior of a computer program as Function (computer programming), procedures (a.k.a. functions, subroutines) that call each o ...
and
declarative programming In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow. Many languages that ap ...
. Data manipulation languages were initially only used within
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
s, but with the advent of SQL have come to be used interactively by database administrators.


See also

* CRUD


Statements

* Select (SQL) * Insert (SQL) * Update (SQL) * Delete (SQL)


Related languages

* Data control language * Data definition language * Data query language


References

*


External links


DML Commands in Oracle
{{Database Data modeling SQL Articles with example SQL code