DDL DML DCL SQL

时间:2021-12-06 09:00:38

https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_ddl

SQL

The Structured Query Language that is standard for performing database operations. Often divided into the categories DDLDML, and queries. MySQL includes some additional statement categories such as replication. See Chapter 10, Language Structure for the building blocks of SQL syntax,Chapter 12, Data Types for the data types to use for MySQL table columns, Chapter 14, SQL Statement Syntax for details about SQL statements and their associated categories, and Chapter 13, Functions and Operators for standard and MySQL-specific functions to use in queries.

See Also DDLDMLqueryreplication.

DCL

Data control language, a set of SQL statements for managing privileges. In MySQL, consists of the GRANT and REVOKE statements. Contrast with DDL andDML.

See Also DDLDMLSQL.

DML

Data manipulation language, a set of SQL statements for performing INSERTUPDATE, and DELETE operations. The SELECT statement is sometimes considered as a DML statement, because the SELECT ... FOR UPDATE form is subject to the same considerations for locking as INSERTUPDATE, and DELETE.

DML statements for an InnoDB table operate in the context of a transaction, so their effects can be committed or rolled back as a single unit.

Contrast with DDL and DCL.

See Also commitDCLDDLlockingrollbackSQLtransaction.

DDL

Data definition language, a set of SQL statements for manipulating the database itself rather than individual table rows. Includes all forms of theCREATEALTER, and DROP statements. Also includes the TRUNCATE statement, because it works differently than a DELETE FROM table_name statement, even though the ultimate effect is similar.

DDL statements automatically commit the current transaction; they cannot be rolled back.

The InnoDB online DDL feature enhances performance for CREATE INDEXDROP INDEX, and many types of ALTER TABLE operations. See Section 15.13, “InnoDB and Online DDL” for more information. Also, the InnoDB file-per-table setting can affect the behavior of DROP TABLE and TRUNCATE TABLEoperations.

Contrast with DML and DCL.

See Also commitDCLDMLfile-per-tablerollbackSQLtransaction.