1. Insert statement1.1 Insert a row There are two types: Note: If there is no parenthesis after the table name, all columns will be added by default. 2. In set form
1.2 Insert multiple rows
Note that multi-row insertion and join query statements are not supported here, and the primary key cannot be empty or repeated. 1.3 Insert query statement
Note that the query statement is run first and then the query result set is inserted into the table, but it must correspond to the column after the table name. The primary key cannot be repeated and cannot be empty, otherwise the insertion will fail. 2. Modify the statement2.1 Modify single table records
2.2 Modify multi-table records1. Use sql92 syntax
2. Use sql99 syntax
3. Delete statement3.1 Method 1: Use delete to delete1. Single table deletion
Will delete all the corresponding data in a whole row 2. Multiple table deletion
This is sql99 syntax, and sql92 syntax is also supported. The table after delete is the table whose contents are to be deleted. 3.2 Method 2: Delete using truncate
Directly delete the data of the entire table 3.3 The difference between using truncate and delete 1. delete can add where conditions but truncat cannot The above is the detailed content of MySQL learning: a detailed explanation of database operation DML for beginners. For more information about MySQL database operation DML, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: html opens a new window with a hyperlink and can control window properties
>>: Discussion on the Issues of Image Button Submission and Form Repeated Submission
1. KVM virtual machine migration method and issue...
Table of contents Axios Request Qs processing dat...
Table of contents 1. Pull the image 1.1 Pull the ...
The installation and configuration method of MySQ...
1. Function Introduction sed (Stream EDitor) is a...
Simple implementation of Mysql add, delete, modif...
Create a database Right click - Create a new data...
This article introduces the method of manually bu...
This article shares the specific code of JavaScri...
background Today, I was browsing CodePen and saw ...
Preface For tree-structured data in the database,...
Table of contents 1. Nginx implements load balanc...
Form provides two ways of data transmission - get ...
ChunkFive Free Typefamily Cuprum JAH I Free font Y...
The application of containers is becoming more an...