<>DML Common commands

* insert into
* update
* delete
<> insert data insert into

* Mode 1 ( Not recommended ) insert into Table name values ( value 1, value 2 , ....);
PS: You cannot see from the command line what the inserted field is , Unable to determine the number of inserted data , Excessive dependence and table structure order of database
When inserting , The order of values must be exactly the same as the order of the table structure , And the number is the same

* Mode 2 ( recommend ) insert into Table name ( field 1, field 2, ...) values ( value 1, value 2 , ...);
<> Batch insert
insert into Table name ( field 1, field 2, ...) value ( value 1, value 2 , ...) , ( value 1, value 2 , ...) , ( value 1, value 2
, ...) , ( value 1, value 2 , ...) , ( value 1, value 2 , ...) , ( value 1, value 2 , ...) ... ;
PS: When inserting , value and values Can be set data

values Suitable for Insertion of single record , The speed is relatively fast
value Suitable for Batch insert , The speed is relatively fast

<> Data update update

It is based on the original data , Changes the values corresponding to some fields of existing data , There will be no new record
-- Full table update ( Not recommended ) update surface set field 1 = value 1 , field 2= value 2 , ... ; -- Update the data according to certain conditions ( recommend )
update surface set field 1 = value 1 , field 2= value 2 , ... where condition ;
<> Delete data delete
-- Delete all tables ( Not recommended ) delete from surface ; -- Conditional deletion ( recommend ) delete from surface where condition ;
<> Delete all tables

* delete from surface ; ( Not recommended )
* truncate table surface ; ( recommend )

Technology
©2020 ioDraw All rights reserved
Unity Illumination overview Common logic questions and pen questions for programmers Why do you need computer major after graduation java What about training ? Where do programmers go when they are over 40 Why do enterprises and factories do energy management and control system JAVA How to output log gracefully in the background Django Of defer and only Detailed explanation of methods Huawei Mate40 Suffer from a mountain stronghold , Carrying snapdragon 865 as long as 898 element One MySQL I'll just hang you up , How dare you write on your resume “ master ”? Gstarcad 3D Operation skills of assembling parts in software