posts - 2,comments - 7,trackbacks - 0

What are the difference between DDL, DML and DCL commands?

DDL is Data Definition Language statements. 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
  • GRANT - gives user's access privileges to database
  • REVOKE - withdraw access privileges given with the GRANT command

DML is Data Manipulation Language statements. 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
  • CALL - call a PL/SQL or Java subprogram
  • EXPLAIN PLAN - explain access path to data
  • LOCK TABLE - control concurrency

DCL is Data Control Language statements. Some examples:

  • 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 what rollback segment to use
posted on 2005-04-16 14:26 潇湘才子杨的博客 阅读(7991) 评论(7)  编辑  收藏

FeedBack:
# re: DDL,DML,DCL区别
2007-11-01 18:06 | gfj
好  回复  更多评论
  
# re: DDL,DML,DCL区别
2007-11-01 18:07 | gfj
适合我这样的菜鸟  回复  更多评论
  
# re: DDL,DML,DCL区别
2007-11-16 12:55 | bob
还有dql,与dml中的select有何不同?谢谢!!!  回复  更多评论
  
# re: DDL,DML,DCL区别
2008-11-25 09:32 | premji
修改数据结构,数据库结构等等的语句成为DDL
比如:alter table, create table, alter user, truncate table等等
修改数据本身的语句成为DML
比如:update,insert,delete

DDL不可以rollback,但是DML可以.
-------------------------------- from Kamus  回复  更多评论
  
# re: DDL,DML,DCL区别
2008-11-25 09:40 | premji
@bob
SQL主要分成四部分:
(1)数据定义。(SQL DDL)用于定义SQL模式、基本表、视图和索引的创建和撤消操作。
(2)数据操纵。(SQL DML)数据操纵分成数据查询和数据更新两类。数据更新又分成插入、删除、和修改三种操作。
(3)数据控制。包括对基本表和视图的授权,完整性规则的描述,事务控制等内容。
(4)嵌入式SQL的使用规定。涉及到SQL语句嵌入在宿主语言程序中使用的规则。
----------------------------------
from http://hi.baidu.com/jjon/blog/item/9837d83ff17eaec47c1e71cb.html  回复  更多评论
  
# re: DDL,DML,DCL区别
2009-06-10 15:56 | hAHAA
HAO  回复  更多评论
  
# re: DDL,DML,DCL区别
2010-03-26 22:45 | JY
Thank you! It is of great user for me.  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: