Mysql database operations (2), mysql database operations
In the previous article, we encountered some common mysql statements. When we need to generate complicated logic, we need to combine mysql statements. At this time, the mysql statements are smelly and long, therefore, we need to know the order in which mysql statements are executed.
For example, in a SELECT statement, there are both group by clauses, order by clauses, and LIMIT clauses. Which clause executes first, which executes second, and which executes later? We can know one or two through the following exploration.
1. What is the execution sequence of mysql statements?
MySQL statements are divided into 11 steps. As marked, the first FROM operation is always executed, and the last LIMIT operation is executed. Each operation generates a virtual table, which serves as a processing input, but these virtual tables are transparent to users, however, only the last virtual table is returned as a result. If a clause is not specified in a statement, the corresponding steps are skipped.
Next, we will analyze each stage of query processing.
/// End