Concepts and Differences of DQL, DML, DDL, DCL

SQL (Structure Query Language) language is the core language of the database.


The development of SQL started in 1974, and its development process is as follows:
1974-----Proposed by Boyce and Chamberlin, it was called SEQUEL at that time.
1976 ----- IBM's Sanjase Institute
changed to SQL when developing RDBMS SYSTEM R.
In 1979 ----- ORACLE published the first commercial RDBMS product based on SQL.
1982 ----- IBM published the first RDBMS language SQL/DS.
1985 ----- IBM published the first RDBMS language DB2.
1986 ----- American National Organization for Standardization ANSI announced SQL as the database industry standard.
SQL is a standard database language, a set-oriented descriptive non-procedural language.
It's powerful, efficient, and easy to
learn ). However, due to the above advantages, the SQL language also has such a problem:
it is a non-procedural language, that is, most statements are executed independently, regardless of context, and
most applications are a complete process, obviously using SQL Fully implementing these functions is
difficult . Therefore, in order to solve this problem, most database companies have done the following two aspects:
(1) Expanding SQL and introducing procedural structures into SQL; (2) Embedding SQL into high-level languages
​​to complete a complete application together .


2. Classification of

SQL language 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 basic structure of data query language DQL is a query block composed of SELECT clause, FROM clause, and WHERE
clause:
SELECT <field name table>
FROM <table or view name>
WHERE <query condition>

2. Data Manipulation language DML
Data manipulation language DML mainly has three forms:
1) Insert: INSERT
2) Update: UPDATE
3) Delete: DELETE

3. Data Definition Language DDL
Data Definition Language DDL is used to create various objects in the database---- - Tables, views,
indexes, synonyms, clusters, etc. such as:
CREATE TABLE/VIEW/INDEX/SYN/CLUSTER
| | | | |
table view index synonym clusters

DDL operations are implicitly committed! Can not rollback 

4. Data Control Language DCL
Data Control Language DCL is used to grant or reclaim certain privileges to access the database, and to control
the time and effect of database manipulation transactions, and to monitor the database. Such as:
1) GRANT: authorization.


2) ROLLBACK [WORK] TO [SAVEPOINT]: Roll back to a certain point.
Rollback --- The ROLLBACK
rollback command returns the database state to the last committed state. Its format is:
SQL>ROLLBACK;


3) COMMIT [WORK]: Commit.


    Insert, delete, and modify operations in the database are completed only when the transaction is committed to the
database . Before the transaction is committed, only the person operating the database has the right to
see what has been done, and others can only see it after the final commit.
There are three types of commit data: explicit commit, implicit commit, and automatic commit. The three types
are .


(1) Explicit submission
The submission that is directly completed with the COMMIT command is an explicit submission. Its format is:
SQL>COMMIT;


(2) Implicit commit
The commit done indirectly with the SQL command is an implicit commit. These commands are:
ALTER, AUDIT, COMMENT, CONNECT, CREATE, DISCONNECT, DROP,
EXIT, GRANT, NOAUDIT, QUIT, REVOKE, RENAME.


(3) Automatic commit If AUTOCOMMIT is set to ON, the system will automatically commit
after inserting, modifying, and deleting statements , which is called automatic committing.
Its format is:
SQL>SET AUTOCOMMIT ON;

https://www.cnblogs.com/fan-yuan/p/7879353.html

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325045658&siteId=291194637