To manipulate records in a data table:
"1" Insert record:
method One: INSERT [into] tbl_name [(Col_name,...)] {VALUES | VALUE} ({expr | DEFAULT},...), (...),... You can insert multiple records at once.
If you are ready to assign a value to the default AutoNumber field, it can be written as null or default, which still adheres to the original increment form.
If you omit a column name, all columns must be assigned values in turn.
In addition to writing the exact data, we can also write expressions (mathematical expressions, character expressions, functions).
If some of the fields are given a default value, you can also use default to give it.
We can also write multiple records at once:
MD5 (): A function in PHP that computes the hash of the MD5 of a string
method Two : INSERT [into] tbl_name SET col_name={expr | DEFAULT},...
!!! The difference from the first approach is that this method can use subqueries (subquery)!!!
This method can only insert one record at a time
method Three : INSERT [into] tbl_name [(Col_name,...)] SELECT ...
!!! This method inserts the query results into the specified data table!!!
"2" Update record (single table update):
UPDATE [low_priority] [IGNORE] table_reference SET
col_name1={expr | DEFAULT} [, col_name2={expr| Defaul}] ...
[WHERE Where_condition]
Omitting the Where condition causes all records to be updated
You can update a column, or you can update multiple columns at the same time
You can add conditions during the update process:
"3" Delete record (single table delete):
DELETE from Tbl_name [WHERE where_condition]
Even if the ID number is not contiguous after deleting the record, the maximum value of the ID number is still +1 when the record is inserted again
MySQL Basic beginner learning "6"