mysql data manipulation statement

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

mysql data manipulation statement

When I operate the data in the database, we have three kinds of data manipulation statements, namely INSERT, DELETE, UPDATE.

The INSERT statement is as follows:

INSERT INTO table name (column, column) VALUES (value, value);

Adding multiline values ​​can be written as:

INSERT INTO tablename(column,column) VALUES(value,value),(value,value)

When using the INSERT statement, we should pay attention to the following points:

If there is a column that is required, you need to bring it.

The auto-numbered column does not need to be filled, it will be obtained automatically.

When filling in the value, single quotation marks are not required except for numerical values, and single quotation marks are required for other types of values.

We can also get the system time with SYSDATE().

You can use PASSWORD (value) to encrypt the value MD5.

image

The DELETE statement is as follows:

DELETE FROM 表名;

Can be followed by a WHERE conditional statement.

image

The UPDATE syntax is as follows:

UPDATE table name SET column=value, column=value;

You can also add a WHERE conditional statement after it.

image

Guess you like

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