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
Data Query Language DQL The basic structure is a query block consisting of a SELECT clause, a FROM clause, a WHERE
clause:
Select < field name table;
from < table or view name;
WHERE < query criteria
2. Data manipulation Language
Data Manipulation language DML has three main forms:
1) Insert: Insert
2) Updated: Update
3) deleted: 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, and so on:
Create Table/view/index/syn/cluster
| | | | |
Table View Index thesaurus
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 that the database manipulates transactions, to monitor the database, and so on. For example:
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.
When a database is inserted, deleted, and modified, only when the transaction is committed to the data
Only when the library is complete. Before a transaction is committed, only the person who operates the database will be able to see
To do things, others can only be seen after the final submission is completed.
There are three types of submission data: explicit commit, implicit commit, and auto-commit. The following points
Do not describe these three types.
(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 the autocommit is set to ON, after the insert, modify, DELETE statement executes,
The system will commit automatically, which is automatic submission. The format is:
Sql>set autocommit on;
SQL language Classification