DDL
Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples:
CREATE
- to create objects in the databaseALTER
- alters the structure of the databaseDROP
- delete objects from the databaseTRUNCATE
- remove all records from a table, including all spaces allocated for the records are removedCOMMENT
- add comments to the data dictionaryRENAME
- 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 databaseINSERT
- insert data into a tableUPDATE
- updates existing data within a tableDELETE
- deletes all records from a table, the space for the records remainMERGE
- UPSERT operation (insert or update)CALL
- call a PL/SQL or Java subprogramEXPLAIN PLAN
- explain access path to dataLOCK 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 databaseREVOKE
- 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 doneSAVEPOINT
- identify a point in a transaction to which you can later roll backROLLBACK
- restore database to original since the last COMMITSET 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