📜  DDL和TCL的区别

📅  最后修改于: 2021-09-10 01:52:31             🧑  作者: Mango

先决条件 – SQL 命令

1. 数据定义语言(DDL):
顾名思义,数据定义语言是用来定义数据库模式的。例如:create table、alter table 是 SQL 中的一些 DDL 指令。

2.事务控制语言(TCL):
顾名思义,事务控制语言包含那些用于管理数据库内事务的命令。 DDL和TCL的区别:

S.No. DDL TCL
1. It stands for Data Definition Language. It stands for Transaction Control Language.
2. It is used to define data structures or overall database schema. It contains those commands, which are used to manage transactions within the database.
3. By using DDL commands, database transactions cannot be handled. TCL commands are meant to handle database transactions.
4. Files can be easily maintained by DDL commands. It manages the different tasks with the important feature, Atomicity.
5. While writing any query, usually DDL statements are written before TCL statements. Usually, TCL statements are written before DDL statements.
6. DDL does not require any log files to maintain the database. It uses log files to keep track of records of all transactions in a database.
7. Some DDL commands which are frequently used : CREATE, ALTER, DROP. Some TCL commands which are frequently used : COMMIT, ROLLBACK.