FROM Clause

The FROM clause tells a SQL query which table (or tables) to read data from. It almost always follows the list of columns in a SELECT statement.

SQL

Every SELECT that reads stored data needs a FROM clause to know where the data lives. You can also list multiple tables and connect them with JOINs to combine related information.

You can give a table a short alias in the FROM clause, which is handy when writing joins or referencing the same table more than once.

Syntax

SELECT columns FROM table_name;

Examples

SQL

SELECT name FROM users;

Output:

name
-----
Alice
Bob

Learn it in a lesson

See also

Back to the Dictionary