How to write database query statements: [SELECT select_list [FROM table_source] [WHERE search_condition] [GROUP BY group_by_expression]].
The database used in this article is db_Test and the data table is Employee
(Related recommendations: mysql video tutorial)
1. Basic structure of SELECT statement
The statement syntax is simply summarized as:
SELECT select_list [INTO new_table_name] [FROM table_source] [WHERE search_condition] [GROUP BY group_by_expression] [HAVING search_condition] [ORDER BY order_expression [ASC | DESC]]
3. SELECT...FROM...clause
Example: In Query the name and age information of all female employees in Employee, and rename the column;
There are three ways to rename the column:
1. Column Name as new column name
2. Column name = new column name
3. Column name new column name
Recommended tutorial: mysql tutorial
The above is the detailed content of How to write database query statements. For more information, please follow other related articles on the PHP Chinese website!