<>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
Gates : Social media bans may cause more disagreements , For example, trump is banned by twitter Bug Can data be used as the basis of technical personnel assessment KPI?vue Defining nested routes 2021 The most complete AI book list Python Basic knowledge and notes A new generation of apple AirPods Appearance exposure , As soon as next month !C++ cin Enter multiple data Software testing BUG describe solve warning: environment variable 'STAGING_DIR' not defined Classical algorithm - recursion ( The case of raw rabbit )