Get the App
SLTechnology News&Howtos  ›  Database  › 

The Writing method of query statement in mysql Database

Shulou Source: shulou.com Published: 2022-06-01 02:11:54 09月13日 Update

This article will explain in detail how to write query sentences about mysql database. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Database query statement is written as follows: [SELECT select_list [FROM table_source] [WHERE search_condition] [GROUP BY group_by_expression]].

The database used in this paper is db_Test, and the data table is Employee.

1. The basic structure of SELECT sentence

The sentence syntax is simply summarized as follows:

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]]

III. SELECT...FROM... Clause

Example: query the name and age information of all female employees in Employee, and list them separately.

There are three ways to get another list:

1. Column name as new column name

two。 Column name = new column name

3. Column name new list

On the mysql database query statement to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Data statements databases queries writing more articles good practical information content employees names clauses age used datasheets articles methods knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno vpn Linux Shulou Information Shulou Technology