1. DDL(Data Definition Language)
The database Definition Language statements is used to define the the database structure or schema. A three-level structure for defining a database, including external, conceptual, internal, and inter-image, defining constraints such as data integrity, security controls, and so on. DDL does not require a commit.
The DDL operation includes:
CREATE
Alter
DROP
TRUNCATE
COMMENT
RENAME
2.DML(Data Manipulation Language)
Data Manipulation Language statements is used for managing data within schema objects. Provided by the DBMS for use by the user or programmer to implement operations on the database. DML is divided into two classes: interactive DML and embedded DML. Depending on the level of the language, DML can be divided into procedural DML and non-procedural DML two species. A commit is required.
DML operations include the following:
SELECT
INSERT
UPDATE
DELETE
MERGE
Pager
EXPLAIN PLAN
LOCK TABLE
3.DCL(Data Control Language)
Database Control Language , such as authorization, role control, etc. The DCL operation contains:
Grant Authorization
REVOKE Cancel Authorization
4.TCL(Transaction Control Language)
The transaction control language. TCL operations include:
SavePoint to set the save point
ROLLBACK rollback
SET TRANSACTION
5. Summary:
SQL is divided into four main parts :
(1) Data definition. (DDL) is used to define the creation and undo operations of SQL schemas, basic tables, views, and indexes.
(2) Data manipulation. (DML) Data manipulation is divided into two categories: Data query and Data update. Data update is divided into three kinds of operations, inserting, deleting, and modifying.
(3) Data control. Includes authorization for basic tables and views, description of integrity rules, transaction control, and so on.
(4) The use of Embedded SQL rules. involves embedding rules that SQL statements use in the host language program.
SQL in four languages: DDL, DML, DCL, TCL