Simple data table of contents CRUD (DQL)

1.insert statement ---- data recorded an increase in
one way: all written
grammar: insert into table name (column name, column name, column names ...) values (value, value, value ...);
Second way: omit some columns ,
example:

three ways: all columns omitted
syntax: insert into table values (value, value, value, value);
1, the number of columns in the table, there are a plurality of values.
2. The structure of the table, and columns correspond to the value.
Example: 2.update statement ---- modify the table record
syntax: update table set column name = value, column name = value ... [where conditional statements];
Note:
1, if not conditions, will modify a column all values.
2, in general data is modified, the conditions required to increase. Multiple columns separated by commas.
Example:



3.delete statement to delete data in a table ----- statement
syntax: delete from table [where conditional statement]
to delete rows of data to meet the conditions. delete to delete rows of data.
Note: If no where, delete all the records in the table.
Here Insert Picture Description
4.Truncate statement ---- delete data
syntax: truncate table table name:
delete the table, and then create a table, it means that all data is deleted.

Guess you like

Origin blog.csdn.net/qq_37252930/article/details/94725342