Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the concepts of DDL, DML, DCL and data submission?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the concepts of DDL, DML, DCL and the submission of data. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

Functionally, SQL language can be divided into three categories: DDL,DML and DCL.

1. DDL (Data Definition Language)

Data definition language, a language for defining and managing all objects in an SQL database

CREATE--- create tables

ALTER--- modify table

DROP--- delete table

2. DML (Data Manipulation Language)

Data manipulation language and data processing in SQL are collectively referred to as data manipulation language.

Insertion of INSERT--- data

Deletion of DELETE--- data

Modification of UPDATE--- data

Query of SELECT--- data

3. DCL (Data Control Language)

Data control language, which is used to grant or recover certain privileges to access the database, to control the time and effect of database manipulation transactions, to monitor the database, etc.

GRANT--- authorization.

ROLLBACK--- rollback.

COMMIT--- submission.

4. There are three types of submission data: explicit submission, implicit submission, and automatic submission.

These three types are described below.

(1) explicit submission

A commit that is done directly with the COMMIT command is an explicit commit.

(2) implicit submission

A commit that is 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 submission

If AUTOCOMMIT is set to ON, the system will commit automatically after the insert, modify and delete statements are executed, which is called automatic commit. Its format is: SQL > SET AUTOCOMMIT ON

Be careful when using the COMMIT / ROLLBACK commands. COMMIT / ROLLBACK is used after the execution of DML statements (INSERT / DELETE / UPDATE / SELECT). After the DML statement is executed, the data processed will be placed in the rollback segment (except the SELECT statement), waiting for the user to submit (COMMIT) or ROLLBACK (rollback). When the user executes COMMIT / ROLLBACK, the data placed in the rollback segment will be deleted.

(after the SELECT statement is executed, the data exists in the shared pool. When it is provided to others to query the same data, it is directly extracted in the shared pool, and there is no need to extract it from the database, which improves the speed of data query. )

All DML statements are explicitly committed, that is, the COMMIT is executed after the DML statement is executed. Others, such as DDL statements, are implicitly submitted. That is, after running those non-DML statements, the database has been implicitly committed, such as CREATE TABLE, after running the script, the table has been built, and you are no longer required to explicitly commit.

You can roll back a transaction with rollback before committing a transaction (commit)

About DDL, DML, DCL concepts and data submission is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report