Concepts and differences of DQL, DML, DDL, DCL

Source: Internet
Author: User

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


The development of SQL began in the 1974, and its development process is as follows:
1974-----Presented by Boyce and Chamberlin, then called sequel.
1976-----IBM's Sanjase Institute developed the RDBMS SYSTEM R
To SQL when it is changed.
1979-----Oracle publishes its first SQL-based, commercially-oriented RDBMS product.
1982-----IBM published its first RDBMS language sql/ds.
1985-----IBM published its first RDBMS language DB2.
1986-----The United States National Standardization Organization ANSI announces SQL as the database industry standard.
SQL is a standard database language and a descriptive non-procedural language for collections.
It has strong function, high efficiency, easy to learn and easy to maintain (so far, I have not seen better than it
Learning language). However, because of these advantages, the SQL language also has a problem:
It is a non-procedural language, that is, most statements are executed independently, context-independent, and
Most applications are a complete process, and it is obvious that using SQL to fully implement these functions is very difficult
Difficult. As a result, most database companies have done two things to solve this problem:
(1) Expand SQL, introduce the procedural structure in SQL, (2) Embed SQL into the high-level language,
In order to complete a complete application together.


Two. Classification of SQL languages

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 a database and to control
The time and effect of database manipulation transaction, and the monitoring of database. 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.


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:
The concept and difference of Sql>set autocommit on;dql, DML, DDL, DCL

Concepts and differences of DQL, DML, DDL, DCL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.