To know whether create requires commit, you need to understand these basic database sql language knowledge.
DDL: Database definition language, used to create databases, create tables, etc.
DML: database management language, such as add, delete, modify, query statements, etc.
DCL: Database operation language, such as modifying database system permissions.
DQL: Data query language, such as fuzzy query and connection query.
Here is a comparison between DML and DDL.
DML language, such as update, delete, insert, etc. that modify the data in the table require commit;
DDL language, such as create, drop, etc. that change the table structure, do not need to write commit (because Commit is hidden internally);
DDL data definition language:
create table create table
alter table modify table
drop table delete table
truncate table Delete all rows in the table
create index Create index
drop index Delete index
When executing a DDL statement, Oracle will submit the current transaction before and after each statement. If the user uses the insert command to insert records into the database and then executes a DDL statement (such as create table), the data from the insert command will be submitted to the database. When the execution of the DDL statement is completed, the DDL statement will be automatically submitted and cannot be rolled back.
DML data operation language:
insert insert records into the database
update modify the records of the database
delete delete the records of the database Record
If it is not submitted when executing a DML command, it will not be seen by other sessions. Unless a 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 unsubmitted DML command.
The above is the detailed content of Does create require commit?. For more information, please follow other related articles on the PHP Chinese website!