How to write database query statements

王林
Release: 2020-10-26 15:31:58
Original
21296 people have browsed it

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]]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!