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:

ClauseDescription
SELECT column_listSpecifies the columns you want to retrieve data from.
FROM table_nameSpecifies the table you are querying.
WHERE conditionFilters records based on a specified condition.
ORDER BY column_listSorts the result set in ascending or descending order.
GROUP BY column_nameGroups rows that have the same values into summary rows.