Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to design efficient and reasonable MySQl query statements? Summary of 23 commonly used types

Shulou Source: shulou.com Published: 2022-06-02 05:17:04 10月01日 Update

MySQL is a very thorny problem for many Linux practitioners, most of which are due to the lack of clarity on how to deal with the problems in the database. Before optimizing MySQL, we must understand the query process of MySQL. A lot of query optimization work actually follows some principles to make the optimizer of MySQL run in the expected and reasonable way. Do you really know what MySQL is?

1. What is a database?

Database (Database) is a warehouse that organizes, stores and manages data according to data structure. with the development of information technology and market, data management is no longer just storing and managing data, but has been transformed into a variety of data management methods needed by users. There are many types of databases, from the simplest tables that store all kinds of data to large database systems that can store massive data.

The mainstream databases are: sqlserver,mysql,Oracle, SQLite, Access, MS SQL Server and so on. I mainly talk about mysql.

2. What is database management for?

a. Save data to a file or memory

b. Receive specific commands, and then take appropriate actions on the file

3. Common query statements in MySQL

1. Query numeric data

SELECT * FROM tb_name WHERE sum > 100

Query predicate: >, =,!, =

Tags: Data queries fields statements conditions databases grouping statistics numeric values sorting functions characters strings expressions management variables situations storage information ascending order Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Apple Microsoft NVidia Xiaomi