Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the operation of adding, deleting, changing and searching in MySQL database

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to add, delete, modify and search in the MySQL database, the content is concise and easy to understand, absolutely can make your eyes bright, through the detailed introduction of this article, I hope you can get something.

1. Insert into all fields

2. Insert into the specified field

Second, modify the data

Of course, we can also modify the data according to conditions, such as filtering using where, but only the simplest one is given here.

3. Delete data

Conditional deletion can also be carried out according to where.

Fourth, query data

This query data is the most troublesome, we give some common queries here.

1. Query all fields and some fields

2. Use distinct to remove duplicate data

3. Use limit to specify the number of rows of query results

4. Use order by to sort the results

5. Use where for conditional query

(1) comparison operator

(2) arithmetic and logic operators

To give two examples, other operators are used similarly:

6. Multi-table query

First, give two tables:

(1) Internal join: only values with equal id in both tables are returned

(2) left join: returns all records in the left table, as well as records equal to those in the right table

(3) right join: returns all records including all records in the right table and records equivalent to those in the left table

7. Subquery

That is, there is a set of queries in the query.

There are too many uses here, and it's too troublesome. So this is the simplest example.

8. Group query

(1) grouping using group by

(2) use having to set conditions

9. Regular expressions

Regular expression is the most flexible and highly used one.

The above content is how to add, delete, change and search operations in the MySQL database. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report