Home > database >  The difference between the Oracle DDL and DML
The difference between the Oracle DDL and DML

Time:10-25

DML: data manipulation language, SQL operations such as processing data are collectively referred to as data manipulation language, they are the SELECT, UPDATE, INSERT, DELETE, just like its name, this article 4 command is used to perform operations on data in the database of the language, do not change the table structure, change the contents of the table, only need to commit to truly implemented,

DDL: data definition language, is used to define and manage all objects in the SQL database language, much larger than the DDL DML, main commands CREATE, ALTER, DROP and so on, the DDL is mainly used in the definition or changing the structure of the TABLE (TABLE), data type, the links and constraints between the TABLE on the initialization, most of them are used in establishing TABLE,

DCL: data control language, used to grant or recycle some privileges to access the database, the database manipulation and control the time of the transaction and effects, monitoring, etc., shall be implemented for the database is the database control function, is used to set or change the database user or role permission statements, including (grant, deny, revoke, etc.), by default, only the sysadmin dbcreator, db_owner or db_securityadmin personnel has the authority to perform DCL,

CodePudding user response:


SQL language is divided into four categories: data query language (DQL, data manipulation language DML, data definition language (DDL and data control language DCL,

1. Data query language DQL
Data query language (DQL basic structure is composed of the SELECT clause, the FROM clause, WHERE
Clause of a query block:
SELECT & lt; Field watches & gt;
The FROM & lt; The table or view name & gt;
WHERE & lt; Query conditions & gt;

2. The data manipulation language DML
Data manipulation language DML mainly has three forms:
1) INSERT: INSERT
2) UPDATE: UPDATE
3) DELETE: DELETE

3. The data definition language (DDL
Data definition language (DDL is used to create all sorts of objects in the database -- -- -- -- -- tables, views,
The index, synonyms, clustering, such as:
The CREATE TABLE/VIEW/INDEX/SYN/CLUSTER
| | | | |
Table view index synonym clusters

DDL operations is implicit commit! Can't the rollback

4. The data control language DCL
Data control language DCL for granted or recycle some privileges to access data in a database, and control the
Database manipulation in the time of the transaction and effect of database for monitoring, etc., such as:
1) GRANT: authorization,


2) the ROLLBACK [WORK] TO [the SAVEPOINT] : back TO a certain point,
ROLLBACK - ROLLBACK
The rollback command the database state back to the last time the last submitted by the state, the following format:
SQL> The ROLLBACK.


3) COMMIT [WORK] : submit,


In the database insert, delete and modify operations, only the transaction data submitted to
Libraries in order to be complete, before the transaction is committed, can only operating database of the people have the right to see
What to do, the other people as you can see, only in the last submitted after the completion of the
Submit data has three types: explicit commit, implicit submission and submit automatically, the following points
Don't show the three types,


(1) explicitly commit
Directly with the COMMIT command to complete submission for explicit submitted, the following format:
SQL> COMMIT;


(2) implicit commit
Complete submission with SQL command indirectly as an implicit commit, these commands are:
The ALTER, AUDIT, COMMENT, CONNECT, CREATE, DISCONNECT, DROP,
The EXIT, GRANT, NOAUDIT, QUIT, REVOKE, RENAME,


(3) the autocommit
If the AUTOCOMMIT mode is set to ON, then the insert, modify, delete statements executed,
The system will automatically submit, this is the autocommit, the following format:
SQL> SET the AUTOCOMMIT ON;


  • Related