MySQL Development - [Basic Operation of Data]

add data

Basic syntax:

1  insert   into    data table [ field name 1, field name 2.. ]  values ​​(data 1, data 2...);
 2 Special attention: for data type integer and floating point data, single or double quotation marks can be omitted , but if the field type is string, the inserted data must be enclosed in single or double quotes.

① Insert product information without specifying a field

②Insert product information in the specified field

Query data

Basic syntax:

1  select   */ [ field name 1, field name 2... ]   from   data table name;

Special note: In practical applications, if the amount of data is too large , it is not recommended to use a semicolon at the end, and it is recommended to use a \G at the end, which represents the vertical display of field information .

1  select   */ [ field name 1, field name 2... ]   from   data table name\G

change the data

Basic syntax:

1  update data table name   set   field name = new field value [ , field name = new field value ]  where   field name = field value;

delete data

Basic syntax:

1  delete   from    datatable    where   field = field value;

Special attention: In actual development, the deletion or modification of data must specify the modification or deletion conditions, otherwise it will cause heavy losses.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324577958&siteId=291194637