Data languages are essential methods and tools provided by database management systems for operating databases. A data language consists of two parts: Data Description Language (DDL), which describes or defines the schemas and features at all levels, also known as a data definition language, and Data Manipulation Language (DML), which manipulates or processes data.
data description language:
Data Definition Language (DDL) is a SQL language that is responsible for the definition of data structures and database objects, composed of three syntaxes: CREATE, ALTER and DROP, and was first used by the Conference on Data Systems Languages data model Start by incorporating the SQL directives as a subset. Most DBMSs support DDL manipulation of database objects, and some databases (such as PostgreSQL) can place DDL in transaction instructions, i.e., it can be retracted (Rollback). Newer versions of the DBMS will incorporate DDL-specific triggers that allow database administrators to track modifications from the DDL.
SQL statements fall into three broad categories:
- Data definition languages are responsible for creating, modifying, and dropping objects such as tables, indexes, views, functions, stored procedures, and triggers.
- Data manipulation languages are responsible for inserting, modifying, deleting, and other operations on data in the database.
- Data control languages are used to grant and revoke user permissions.
data manipulation language:
The data manipulation language DML is one of the primary interfaces between the user and the database system, is a tool for the user to operate on the database, and generally should have the following functions:
- data retrieval function: retrieving data is the most important and frequently used function.
- data update function: add, modify or delete the database so that the data can reflect the entire objective promptly.
- concurrent access control function: coordinate control when multiple users operate simultaneously to ensure the regular use of the database.
The form of the data manipulation language varies from the database management system to the database management system. Its general form consists of action verb, action object, and action qualification. Action verbs can represent functional operations such as data retrieval or update, and action objects can be record names, data item names, etc. The qualifications are mostly logical expressions and condition expressions.
The data manipulation language DML(Data Manipulation Language) allows users to perform basic operations on databases. For example, querying, inserting, deleting, and modifying data in a table. In DML, the application can interpolate, delete, modify, sort, and check the database.
The Differences Between DDL and DML:
Below is all the information about DDL vs. DML, from which you can quickly review all the differences between DDL and DML.
DML is a data manipulation language that uses DML to control the opening, commit manually, and roll back things using DML operations on the database. We generally insert, delete, update, select, add, delete, modify, and check operations.
insert into student values(‘4002’, ‘zhang san’);
delete from student where id=’4002′;
select * from student;
DDL is interpreted as a data definition language; the operation of DDL on transactions is implicitly committed and can not be rolled back; the common operation is to create a database or table, alter and drop operations.
student(id int,name varchar(30);
alter table student drop column age;
In a production environment, DDL-like operations need to be used with caution because root back operations cannot be done and cannot be rolled back once executed.
commit data types: explicit, implicit, and auto-commit.
(1) explicit submission
sql>commit; after data execution, the commit command needs to be executed, which can be done back
(2) implicit submission
for example, the following operation is a hidden submission, and it is impossible to return after submission, and dangerous actions need to be cautious.
alter， audit， comment， connect， create， disconnect， drop，
exit， grant， no audit， quit， revoke， rename。
if auto-commit is set to on, after the insert, modify, or delete statements are executed,
the system will automatically commit automatic submission. the format is:
sql>set auto-commit on；
The main advantage of data language is its high degree of non-procedural, where users only need to know what to do, not how to do it. It has complete expression ability, vital functions and is embedded in high-level languages. Users do not have to ask the database administrator to establish a particular access path. The access path selection is made automatically by the database management system.