1. DDL (Data Definition
Language) database definition language statements
Are used to define the database structure or schema.
DDL is one of the four functions of SQL.
Defines the three-level structure of the database, including the external mode, conceptual mode, internal mode and the image between them, and defines constraints such as data integrity and security control.
DDL does not require commit.
Create
Alter
Drop
Truncate
Comment
Rename
2. DML (data manipulation language) data manipulation language statements are used for managing data within schema objects.
Provided by DBMS for users or programmers to operate data in the database.
DML is divided into two types: Simplified DML and embedded DML.
Based on the language level, DML can be further divided into procedural DML and non procedural DML.
Commit is required.
Select
Insert
Update
Delete
Merge
Call
Explain plan
Lock table
3. DCL (Data Control Language) Database Control Language authorization, role control, etc.
Grant authorization
Revoke authorization from revoke
4. TCL (transaction control language) Transaction Control Language
Savepoint settings
Rollback rollback
SET transaction
SQL is mainly divided into four parts:
(1) data definition. (SQL ddl) is used to define the creation and revocation operations of SQL modes, basic tables, views, and indexes.
(2) data manipulation. (SQL DML) data manipulation is divided into two types: Data Query and data update. Data Update is divided into insert, delete, and modify operations.
(3) Data Control. Includes authorization for basic tables and views, description of integrity rules, and transaction control.
(4) embedded SQL usage regulations. It involves the rules used by SQL statements embedded in the host language program.