What are the difference between DDL, DML and DCL commands?
DDL,DML和DCL命令之间的区别?(DDL是数据定义语言,如:)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(撤销由GRANT命令赋予的访问权限)
DML is Data Manipulation Language statements. Some examples:(DML是数据操作语言,如:)
- 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(调用一个PL/SQL或JAVA子程序)
- EXPLAIN PLAN - explain access path to data(解释分析数据的访问路径)
- LOCK TABLE - control concurrency(控制并发)
DCL is Data Control Language statements. Some examples:(DCL 是数据控制语言,如:)
- 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(在最近一次COMMIT之后重新保存数据库)
- SET TRANSACTION - Change transaction options like what rollback segment to use(改变事务选项)