1.DDL(DataDefinition Language)DatabaseDefinition LanguageStatements are used to define the database structure or schema.
DDL isSQLOne of the four major functions of the language.
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 languageStatements are used for managing data within schema objects.
Provided by DBMS to allow users orProgramTo perform operations on 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 LanguageAuthorization, 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.