DDL、DML、DCL、TCL基础(译文)

原文:blog.isdevil.com


DDL

Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:

  • CREATE - to create objects in the database
  • ALTER - alters the structure of the database
  • DROP - delete objects from the database
  • TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
  • COMMENT - add comments to the data dictionary
  • RENAME - rename an object
    译:

数据定义语言(DDL)语句用来定义数据库结构或模式。例如:

  • create-创建数据库对象
  • alter-修改数据库的结构
  • drop-从数据库中删除对象
  • truncate-移除表中的所有记录,包括分配给记录的空间也会被移除
  • comment-为数据字典加一些评论
  • rename-给数据库对象重新命名

DML

Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:

  • SELECT - retrieve data from the a database
  • INSERT - insert data into a table
  • UPDATE - updates existing data within a table
  • DELETE - deletes all records from a table, the space for the records remain
  • MERGE - UPSERT operation (insert or update)
  • CALL - call a PL/SQL or Java subprogram
  • EXPLAIN PLAN - explain access path to data
  • LOCK TABLE - control concurrency
    译:

数据操纵语言(DML)语句用来管理数据对象内的数据。例如:

  • select-从数据库中取回数据
  • insert-向表中插入数据
  • update-更新表中已经存在的数据
  • delete-删除表中的记录,分配给记录的空间会保留
  • merge-UPSERT操作(插入或更新)
  • call-呼叫一个PL/SQL或者java小程序
  • explain plan-解释数据的访问路径
  • lock table-控制并发

DCL

Data Control Language (DCL) statements. Some examples:

  • GRANT - gives user’s access privileges to database
  • REVOKE - withdraw access privileges given with the GRANT command

译:

数据控制语言(DCL)语句。

  • grant-授予用户一些对数据库的访问权限
  • revoke-回收用grant授予给用户的权限

TCL

Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.

  • COMMIT - save work done
  • SAVEPOINT - identify a point in a transaction to which you can later roll back
  • ROLLBACK - restore database to original since the last COMMIT
  • SET TRANSACTION - Change transaction options like isolation level and what rollback segment to use

译:

事务控制(TCL)语句 用来管理被DML语言做出的改变。TCL允许将一系列语句分组成一个逻辑上的事务。

  • commit-提交事务。保存已经做好的工作
  • savepoint-保存点。标识一个以后用来回滚到当前的点
  • rollback-恢复数据库到上一次commit后的状态
  • set transaction-改变事务的参数。例如:隔离的登记以及要使用的回滚段

参考资料:https://www.cnblogs.com/gnielee/archive/2009/07/31/1535621.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值