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

How to use DDL,DML,DCL,TCL in SQL

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly introduces how to use DDL,DML,DCL,TCL in SQL. It is very detailed and has a certain reference value. Friends who are interested must finish it!

1.DDL (Data Definition Language) database definition language statements are used to define the database structure or schema.

DDL is one of the four functions of SQL language.

Used to define the three-level structure of the database, including external schema, conceptual schema, internal schema and their images between them, and define data integrity, security control and other constraints

DDL does not need commit.

CREATE

ALTER

DROP

TRUNCATE

COMMENT

RENAME

2.DML (Data Manipulation Language) data manipulation language statements are used for managing data within schema objects.

Provided by DBMS, it is used by users or programmers to realize the operation of the data in the database.

DML can be divided into two types: mutual DML and embedded DML.

According to the level of language, DML can be divided into procedural DML and non-procedural DML.

Need commit.

SELECT

INSERT

UPDATE

DELETE

MERGE

CALL

EXPLAIN PLAN

LOCK TABLE

3.DCL (Data Control Language) database control language authorization, role control, etc.

GRANT authorization

REVOKE cancels authorization

4.TCL (Transaction Control Language) transaction control language

SAVEPOINT set SavePoint

ROLLBACK rollback

SET TRANSACTION

SQL is mainly divided into four parts:

(1) data definition. (SQL DDL) is used to define the creation and undo operations of SQL schemas, basic tables, views, and indexes.

(2) data manipulation. (SQL DML) data manipulation is divided into two categories: data query and data update. Data update is divided into three operations: insert, delete, and modify.

(3) data control. It includes authorization of basic tables and views, description of integrity rules, transaction control, and so on.

(4) the rules for the use of embedded SQL. Involves rules that SQL statements are embedded in the host language program.

The above is all the contents of the article "how to use DDL,DML,DCL,TCL in SQL". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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