Home  >  Article  >  Database  >  How to write database query statements

How to write database query statements

王林
王林Original
2020-10-26 09:12:0621398browse

How to write database query statements: [SELECT select_list [FROM table_source] [WHERE search_condition] [GROUP BY group_by_expression]].

How to write database query statements

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;

How to write database query statements

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!

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
Previous article:How to reinstall mysqlNext article:How to reinstall mysql