Oracle DDL,DML,DCL,TCL Basic Concepts __oracle

Source: Internet
Author: User
Tags commit rollback savepoint
For SQL languages, there are two components:

DML (Data Manipulation language): They are select, UPDATE, INSERT, DELETE, just like its name, these 4 commands are the languages used to manipulate the data in the database.

DDL (data Definition Language): DDL is more than DML, the main commands are create, ALTER, drop, etc., the DDL is mainly used in the definition or change of tables (table) structure, data type, table links and constraints, such as the initialization of work, Most of them are used when creating tables. Answer by: Zhongsojun | Level Three | 2009-9-1 19:30

SQL language is divided into four categories: Data Query Language DQL, Data manipulation language DML,

Data definition language DDL, Data Control Language DCL.

1 Data Query Language DQL

Data Query Language DQL The basic structure is the SELECT clause, the FROM clause, where

A query block consisting of a clause:

SELECT < field Name table >

From < table or view name >

WHERE < query conditions >

2 Data Manipulation language

Data manipulation language DML mainly has three kinds of forms:

1) Inserting: Insert

2) Updated: Update

3) Deletion: Delete

3 Data Definition Language DDL

Data definition Language DDL is used to create various objects in a database-----tables, views,

indexes, synonyms, clusters, etc. such as:

CREATE Table/view/index/syn/cluster

4 Data Control Language DCL

The Data Control Language DCL is used to grant or reclaim certain privileges to access the database and to control

The database manipulates the time and effect that the transaction takes place, monitors the database and so on. Such as:

1 Grant: Authorization.

2) ROLLBACK [WORK] to [savepoint]: Back to a certain point.

Roll Back---ROLLBACK

The rollback command causes the database state to revert to the last-committed state. The format is:

sql>rollback;

3 Commit [WORK]: Submit. Www.2cto.com

When a database is inserted, deleted, and modified, only when the transaction is committed to the data

Library is complete. Before a transaction is committed, only the person who operates the database can be entitled to see

To do things, others can only be seen after the final submission is complete.

There are three types of submitted data: explicit commit, implicit commit, and autocommit. Following points

Don't explain these three types.

(1) Explicit submission

Commits that are done directly with the commit command are explicit commits. The format is:

sql>commit;

(2) Implicit submission

Submissions that are done indirectly with SQL commands are implicitly committed. These commands are:

Alter,audit,comment,connect,create,disconnect,drop,

Exit,grant,noaudit,quit,revoke,rename.

(3) Automatic submission

If the autocommit is set to ON, after the insert, modify, DELETE statement is executed,

The system will automatically commit, which is automatic submission. The format is:

Sql>set autocommit on;

The difference between DDL,DML,DCL

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

The difference between DDL,DML and DCL commands. (DDL is a data definition language, such as:)

The DDL is Data Definition Language statements. Some Examples:

Create-to create objects in the database (objects are created in databases)

Alter-alters the structure of the database (modify the structure of the databases)

Drop-delete objects from the database (deleting objects from the databases)

Truncate-remove all records from a table, including all spaces allocated for the records are removed (remove all records from a table, including assigning to records All the space is also removed)

Comment-add comments to the data dictionary (add a note to the dictionary)

Grant-gives user ' s access privileges to database (give users access)

Revoke-withdraw access privileges given with the GRANT command (revoke access granted by Grant commands)

The DML is Data manipulation Language statements. Some Examples: (DML is a data manipulation language, such as:)

Select-retrieve data from the A database (returns a certain requirement from the specified databases)

Insert-insert data into Table a table (inserts into a list)

Update-updates existing data within a table (updates existing in the table)

Delete-deletes all records from a table, the spaces for the records remain (delete all records in the table, but keep records occupied)

Call-call a pl/sql or Java Subprogram (invoke a pl/sql or Java subroutine)

EXPLAIN plan-explain Access path to data (interpreting access paths for profiling data)

LOCK table-control concurrency (concurrency control)

DCL is Data control Language statements. Some Examples: (DCL is a data control language, such as:)

Commit-save work done (save completed work)

Savepoint-identify a point in a transaction to which can later roll back (mark a dot in the transaction for easy rollback to here)

Rollback-restore database to original since the last commit (re-save the databases after the most recent commit)

SET transaction-change TRANSACTION options like what rollback segment to use (Change transaction options)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.