SQL Command Reference
A quick reference for all major SQL commands and their clauses. Find what you need to manage your relational databases.
The `SELECT` Statement
The SELECT statement is used to query the database and retrieve data that matches criteria that you specify.
The SELECT statement is the most commonly used command in SQL. It allows you to fetch data from one or more tables.
Example
query.sql
SELECT column1, column2
FROM table_name
WHERE condition;Common Clauses
Common clauses used with the SELECT statement:
| Clause | Description |
|---|---|
| SELECT column_list | Specifies the columns you want to retrieve data from. |
| FROM table_name | Specifies the table you are querying. |
| WHERE condition | Filters records based on a specified condition. |
| ORDER BY column_list | Sorts the result set in ascending or descending order. |
| GROUP BY column_name | Groups rows that have the same values into summary rows. |