The SQL language is divided into four categories: Data Query Language DQL, Data manipulation language DML, data definition language DDL, Data Control Language DCL.
1. Data Query Language DQL
The DQL basic structure of the data query language is determined by the SELECT clause, the FROM clause, where
clause consists of a query block:
SELECT < field Name table >
From < table or view name >
WHERE < query conditions >
2. Data manipulation language DML
There are three main forms of data manipulation language DML:
1) Inserting: Insert
2) Updates: Update
3) Remove: Delete
3. Data Definition Language DDL
The data definition language DDL is used to create various objects in the database-----tables, views,
indexes, synonyms, clusters, etc.:
CREATE Table/view/index/syn/cluster
Table View index synonym cluster
DDL operations are implicitly committed! Can't rollback
4. Data Control Language DCL
Data Control Language DCL is used to grant or reclaim some kind of privilege to access the database, and to control the time and effect of database manipulation transactions, to monitor the database and so on. Such as:
1) Grant: authorization.
2) ROLLBACK [work] to [savepoint]: fallback to a point.
Roll Back---ROLLBACK
The rollback command brings the database state back to the last committed state. The format is:
sql>rollback;
3) Commit [work]: Submit.
There are three types of submission data
When inserting, deleting, and modifying a database, the transaction is completed only when it is committed to the database. Before a transaction is committed, only the person who operates the database has permission to see what is being done, and others can only see it after the final commit is completed.
There are three types of submission data: explicit commit, implicit commit, and auto-commit. These three types are described below.
(1) Explicit submission
Commits that are completed directly with the commit command are explicitly committed. The format is:sql>commit;
(2) Implicit submission
Commits that are indirectly completed with SQL commands are implicitly committed. These commands are:
Alter,audit,comment,connect,create,disconnect,drop,exit,grant,noaudit,quit,revoke,rename.
(3) Automatic submission
If Autocommit is set to ON, the system commits automatically after inserting, modifying, and deleting statements, which is automatic submission. The format is: Sql>set autocommit on;
Four categories of MySQL learning---SQL language