SQL Language Division

Source: Internet
Author: User

From the functional partition, the SQL language can be divided into three categories: Ddl,dml and DCL.


1. DDL (Data Definition Language)
A data definition language that defines and manages the language of all objects in a SQL database;
Create---Table
Alter---change table
Drop---Delete table
RENAME---Renaming a table
2. DML (Data manipulation Language)
Data manipulation language, SQL processing data and other operations are collectively referred to as data manipulation language;
Insert---Data
REPLACE----with insert. Instead of an error, a replacement is run when a conflict occurs.
Delete---Deletion of data
UPDATE---Changes to data
Query------for SELECT---data should be counted DQL
3. DCL (Data Control Language)
Data Control Language. Used to grant or recycle access to a database of some kind of privilege, and control the time and effect of database manipulation transactions, monitoring the database;
Grant---authorization.
revoke--revoke authorization.
ROLLBACK---rollback.


Commit---commit.

4. There are three types of submission data: Explicit submission, implicit submission, and self-submission.

These three types are described below.

(1) Explicit submission

Commits that are completed directly with the commit command are explicitly committed.
(2) Implicit submission

An implicit commit is an indirect commit with an SQL command.

These commands are:

ALTER . AUDIT. COMMENT. CONNECT. CREATE , DISCONNECT. DROP , EXIT,GRANT , Noaudit, QUIT. REVOKE , RENAME .

(3) Submit your own initiative

If the autocommit is set to ON. After the insert, change, DELETE statement run, the system will voluntarily commit itself, this is the initiative to commit themselves.

The format is: Sql>set autocommit on;
Be careful when commit/rollback these two commands. Commit/rollback are used after the DML statement (Insert/delete/update/select) is run. DML statement after it runs out. The processed data will be placed in the rollback segment (except for the SELECT statement). Wait for the user to commit (commit) or rollback (ROLLBACK) when the user runs Commit/rollback. The data that is placed in the rollback segment is deleted.

(after the SELECT statement is run, the data has a shared pool.) Provided to other people to query the same data, directly in the shared pool to extract, no longer to the database to extract. Improves the speed of data queries. )
All DML statements are to be explicitly committed. This means that a COMMIT is executed after the DML statement is executed. Others, such as DDL statements, are implicitly committed. That is, after executing those non-DML statements, the database has been implicitly committed. such as CREATE TABLE. After executing the script, the table has been built and is not required to be explicitly submitted.

The transaction can be rolled back with rollback before committing the transaction (commit).

SQL Language Partitioning

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.