Knowledge point 1
Delete----Remove values from a single row or all rows
DELETE from my_foods--my_foods is the table that contains the row to be deleted WHERE ='bread';
Delete differs from SELECT: Delete does not need to specify the deleted object, because he is cruel and will delete all columns of the entire row.
Therefore, delete cannot delete the values in a column or all the values of a column in a single row, but you can delete one or more rows (as determined by the where statement). The collocation keyword in the WHERE clause, similar to the use of select, such as like, in, between, can be used here, and all conditions will more accurately require the RDBMS to delete specific rows.
If you want to modify a column value for a row, you can use delete and insert mates to do this: first make sure the value you want to change is the value you really need (because it's hard to recover), then insert the data, delete the original data
SELECT * fromMy_foodsWHEREBreakfast= 'Milk';
INSERT intoMy_foodsVALUES('Bread+milk');
DELETE fromMy_foodsWHEREBreakfast= 'Milk';
The disadvantage of this is that you need to re-enter the same data for all the rows once and reduce the efficiency! Update can simplify this problem!
Knowledge Point 2
UPDATE---Change the value of a single column or all columns (without the where it will modify all the data in that column to the new value)
UPDATE My_foods SET = ' Bread '
If you need to update a single row or multiple rows, everything needs to be given to where to decide
UPDATE my_foods ---Select the updated table set='bread' --set the value of the column why breakfast = ' milk '; --Positioning
...
Of course, SET can not only assign values to various data types, but can also apply some basic operations, functions, and so on.
UPDATE My_foods SET = + 1 WHERE inch ('bread','milk');
SQL Essentials----DELETE and UPDATE