OracleDDL, DML, DCL, and TCL Summary

Source: Internet
Author: User
Summary of OracleDDL, DML, DCL, and TCL: oracle learning can be implemented and maintained independently. Of course, optimization is a long-term experience and requires multiple products.

Summary of Oracle DDL, DML, DCL, and TCL: oracle learning can be implemented and maintained independently. Of course, optimization is a long-term experience and requires multiple products.

Oracle learning can be implemented and maintained independently. Of course, optimization is a long time-consuming experience and requires more experience.

The following are some online materials that you can find.

In general, SQL statements are commonly used for addition, deletion, modification, query, and alter. in oracle, commit and revoke are commonly used. These are very confusing for me and I hope I can continue to work hard.

DDL


Data Definition Language (DDL) statements are used to define the database structure or schema. 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
  • RENAME-rename an object
  • DML


    Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples:

  • SELECT-retrieve data from the 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
  • MERGE-UPSERT operation (insert or update)
  • CALL-call a PL/SQL or Java subprogram
  • Explain plan-explain access path to data
  • Lock table-control concurrency
  • DCL


    Data Control Language (DCL) statements. Some examples:

  • GRANT-gives user's access privileges to database
  • REVOKE-withdraw access privileges given with the GRANT command
  • TCL
    Transaction Control (TCL) statements are used to manage the changes made by DML statements. It allows statements to be grouped together into logical transactions.

  • 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 isolation level and what rollback segment to use
  • The above is relatively official, and the following is an easy-to-understand Method for most people.

    For the SQL language, there are two components:

    DML (data manipulation language): They are SELECT, UPDATE, INSERT, and DELETE, just like their names. These four commands are used to operate the data in the database.

    DDL (data definition language): DDL is more than DML. The main Commands include CREATE, ALTER, and DROP. DDL is mainly used to define or change the database structure and data type, most of the initialization tasks such as links and constraints between tables are used when creating tables.

    SQL languages fall into four categories:

    Data Query Language DQL,

    Data manipulation language DML,

    Data Definition Language DDL,

    Data Control Language DCL.

    1. Data Query Language DQL

    The basic structure of Data Query Language DQL is composed of SELECT clause, FROM clause, WHERE

    Query block composed of clauses:

    SELECT <字段名表>

    FROM <表或视图名>

    WHERE <查询条件>

    2. Data manipulation language

    The data manipulation language DML has three forms:

    1) INSERT: INSERT

    2) UPDATE: UPDATE

    3) DELETE: DELETE

    3. Data Definition Language DDL

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

    Indexes, synonyms, and clustering, for example:

    Create table/VIEW/INDEX/SYN/CLUSTER

    4. Data Control Language DCL

    The Data Control Language DCL is used to grant or revoke some privileges to access the database and Control

    The time and Effect of database operations and transactions, and the monitoring of the database. For example:

    1) GRANT: authorization.

    2) ROLLBACK [WORK] TO [SAVEPOINT]: roll back TO a certain point.

    ROLLBACK --- ROLLBACK

    The rollback command returns the database status to the last submitted status. The format is:

    SQL> ROLLBACK;

    3) COMMIT [WORK]: Submit.

    During database insertion, deletion, and modification operations, only when the transaction is committed to the data

    The database is complete. Before the transaction is committed, only the person who operates the database can view

    You can only see what you do after the final submission.

    You can submit data explicitly, implicitly, or automatically. Points below

    Do not describe these three types.

    (1) explicit submission

    You can use the COMMIT command to directly submit an object explicitly. The format is:

    SQL> COMMIT;

    (2) Implicit commit

    The SQL command is used for implicit submission. These commands are:

    ALTER, AUDIT, COMMENT, CONNECT, CREATE, DISCONNECT, DROP,

    EXIT, GRANT, NOAUDIT, QUIT, REVOKE, RENAME.

    (3) automatic submission

    If AUTOCOMMIT is set to ON, after the insert, modify, or delete statement is executed,

    The system will automatically submit. The format is:

    SQL> SET AUTOCOMMIT ON;

    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.