dml语句包括哪些_SQL | DDL, DML, TCL and DCL

e7677ab2c3b7282266584e51cbbab3ee.png

SQL命令按照上图分为四类,DDL,DML,DCL,TCL

DDL (Data Definition Language) :

DDL用于定义 数据库的结构或schema,DDL也用于指定数据额外的属性。

数据存入数据库必须满足特定的一致性约束 consistency constraints

比如,假设大学要求账户余额不能为负数,DDL提供这种能力来指定这种约束。

数据库会在每次数据更新的时候来检查这些约束。

命令包括

CREATE : to create objects in database
ALTER : alters the structure of database
DROP : delete objects from database
RENAME : rename an objects

DML (Data Manipulation Language) :

DML语句又分为两类

声明式(Declarative DMLs)和过程式(Procedural DMLs)

过程式DML 需要指定获取哪些数据 以及如何获取

声明式DML只需要指定要获取哪些数据,不用管如何获取。

命令包括

SELECT: retrieve data from the database
INSERT: insert data into a table
UPDATE: update existing data within a table
DELETE: deletes all records from a table, space for the records remain

TCL (Transaction Control Language) :

事务控制语言用于管理数据库的事务

命令包括

COMMIT: Commit command is used to permanently save any transaction
            into the database.
ROLLBACK: This command restores the database to last committed state.
            It is also used with savepoint command to jump to a savepoint
            in a transaction.
SAVEPOINT: Savepoint command is used to temporarily save a transaction so
            that you can rollback to that point whenever necessary.

DCL (Data Control Language) :

命令如:

GRANT: allow specified users to perform specified tasks.
REVOKE: cancel previously granted or denied permissions.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值