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
When using TensorFlow for deep learning, insuffic...
This article example shares the specific code of ...
Most people compile MySQL and put it in the syste...
For a website, usability refers to whether users c...
MySQL has the following logs: Error log: -log-err...
This article shares the specific code of JavaScri...
The following questions are all based on the Inno...
In the project, form testing is often encountered...
This article describes how to build a phalcon env...
1. Background that needs to be passed through CSS...
Table of contents introduction 1. What is one-cli...
Contents of this article: Page hollow mask layer,...
Detailed explanation of HTML (select option) in ja...
CentOS 8 is now available! CentOS 8 and RedHat En...
Table of contents 1. Check the status of the serv...