天天看點

資料庫中的DDL/DML/DCL解釋(轉)

DDL is Data Definition Language statements. Some examples:資料定義語言,用于定義和管理 SQL 資料庫中的所有對象的語言

1.CREATE - to create objects in the database 建立

2.ALTER - alters the structure of the database 修改

3.DROP - delete objects from the database 删除

4.TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed 清空

5.COMMENT - add comments to the data dictionary 注釋

6.GRANT - gives user's access privileges to database 授權

7.REVOKE - withdraw access privileges given with the GRANT command 收回已經授予的權限

DML is Data Manipulation Language statements. Some examples:資料操作語言,SQL中處理資料等操作統稱為資料操縱語言

1.SELECT - retrieve data from the a database 查詢

2.INSERT - insert data into a table 添加

3.UPDATE - updates existing data within a table 更新

4.DELETE - deletes all records from a table, the space for the records remain 删除

5.CALL - call a PL/SQL or Java subprogram

6.EXPLAIN PLAN - explain access path to data

7.LOCK TABLE - control concurrency 鎖,用于控制并發

DCL is Data Control Language statements. Some examples:資料控制語言,用來授予或回收通路資料庫的某種特權,并控制資料庫操縱事務發生的時間及效果,對資料庫實行監視等

1.COMMIT - save work done 送出

2.SAVEPOINT - identify a point in a transaction to which you can later roll back 儲存點

3.ROLLBACK - restore database to original since the last COMMIT 復原

4.SET TRANSACTION - Change transaction options like what rollback segment to use 設定目前事務的特性,它對後面的事務沒有影響.

以上解釋如下圖所示:

資料庫中的DDL/DML/DCL解釋(轉)

 ​