Home  >  Article  >  Database  >  What are the operations of mysql add, delete, modify and query statements?

What are the operations of mysql add, delete, modify and query statements?

coldplay.xixi
coldplay.xixiOriginal
2020-08-11 12:00:2311685browse

mysql add, delete, modify and query statement operations: 1. Use the select statement to query, the code is [SELECT * FROM biao1]; 2. Use insert to insert data, the code is [INSERT INTO biao1 ()]; 3. Use delete delete data.

What are the operations of mysql add, delete, modify and query statements?

mysql add, delete, modify and query statement operations:

1. Open sqlyog to create a new connection to manage the database and click on the file -》New connection, or directly click the green button in the picture

What are the operations of mysql add, delete, modify and query statements?

Related learning recommendations: mysql video tutorial

2. Then fill in the installed mysql database information, host address, user name, password and database name

What are the operations of mysql add, delete, modify and query statements?

3, then click "Link", If there are no errors in the information, the connection information and database-related information will be displayed on the left, and the query box on the right can be used

What are the operations of mysql add, delete, modify and query statements?

4. First, test the query statement in the query maniac. , query all columns that meet the conditions, and query for specified columns

1.SELECT * FROM biao1

2.select name form biao1

3.SELECT * FROM biao1 WHERE id =6

Select the query statement and click the execute button respectively to display the results in the picture

What are the operations of mysql add, delete, modify and query statements?

5. Insert data into the data. Fill in the query box with INSERT INTO biao1(name1,age) VALUES('newly added 1','1000') and then click the execute button. If successful, a statement will be executed. When running all the query statements, the newly inserted information will be found. Can be queried

What are the operations of mysql add, delete, modify and query statements?

#6. Next, execute the modification statement and write the following code in the query box UPDATE biao1 SET name1="This is a modification",age='2000' WHERE id=20 Change "New 1" in the database to "This is a modification", change "1000" to "2000", select the statement and click Execute, and then query again. The following results will appear, indicating that the modification is successful.

What are the operations of mysql add, delete, modify and query statements?

7. Next, delete the data that already exists in the database through id, delete the

just modified data in the database, and pass DELETE FROM biao1 WHERE id='20', after selecting and executing, you will find that the previous data has been deleted. If you execute the increase, you will find that the id has become 21

What are the operations of mysql add, delete, modify and query statements?

Related learning recommendations: Programming video

The above is the detailed content of What are the operations of mysql add, delete, modify and query statements?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn