DDL and DML in Sql

For data analysts, our operations on the database are nothing more than creating tables, modifying table structures, modifying table contents (additions, deletions, and modifications), and query table contents. The difference between these operations is summarized below

  • DDL data definition language (Data Definition Language)

    • No need to commit
    • Modify the definition of the table
    • create table create table
    • alter table to modify the table
    • drop table delete table
    • truncate table delete all rows in the table
    • create index Create index
    • drop index delete index
    • When executing DDL statements, before and after each statement, Oracle will commit the current transaction. If the user executes a DDL statement (such as create table) after inserting records into the database using the insert command, the data from the insert command will be submitted to the database at this time. When the execution of the DDL statement is completed, the DDL statement will be automatically submitted and cannot be rolled back.
  • DML data manipulation language (Data Manipulation Language)

    • Need to commit
    • Add, delete, modify
    • insert inserts the record into the database
    • update modify database records
    • delete delete records in the database
    • When the DML command is executed, if it is not submitted, it will not be seen by other sessions. Unless the DDL command or DCL command is executed after the DML command, or the user exits the session, or terminates the instance, the system will automatically issue a commit command to submit the uncommitted DML command
  • DQL data query language (Data Query Language)

    • No need to commit
    • check
    • select query

 

Guess you like

Origin blog.csdn.net/lz_peter/article/details/85329223