The query command in SQL is SELECT. It allows users to extract specific data from database tables, the syntax is: SELECT [column name | expression] FROM [table name] [WHERE filter condition] [ORDER BY sort condition].
The command that represents query in SQL: SELECT
In SQL, the command used to perform query operation is SELECT
. It allows users to extract specific data from database tables.
Syntax:
<code class="sql">SELECT [列名|表达式] FROM [表名] [WHERE 筛选条件] [ORDER BY 排序条件]</code>
Parameters:
Example:
Querycustomers All customer names in the table:
<code class="sql">SELECT name FROM customers;</code>
orders Orders with an amount greater than $100 in the table:
<code class="sql">SELECT * FROM orders WHERE amount > 100;</code>
products The top 5 products in the table sorted by price in descending order:
<code class="sql">SELECT * FROM products ORDER BY price DESC LIMIT 5;</code>
The above is the detailed content of The command that represents query in sql is. For more information, please follow other related articles on the PHP Chinese website!