The SQL FROM clause names the table that supplies data to a query. It works with SELECT: one says which columns to show, while the other points to their source. Think of it as choosing a shelf before picking a book—small detail, but essential for a clear query.

Multiple Choice

What command tells the database which tables to query?

In SQL, the appropriate command to specify which tables to query is 'FROM'. This command is essential in a SQL query structure, as it indicates the source of the data that you want to retrieve. When you use 'SELECT', you are simply indicating which columns of data you want to display, but without 'FROM', there would be no context regarding where that data is coming from. The use of 'FROM' effectively links the selected data with the specific tables you're querying, making it crucial for proper SQL syntax and operation. While commands like 'SELECT' allow you to specify the data you want, 'FROM' clarifies the origin of that data. In conclusion, 'FROM' plays a key role in directing the database to the right tables for the query's operation.

Why FROM Matters in an SQL Query

A database can hold thousands of records, but a useful query starts by knowing where to look. In SQL, the FROM clause names the table—or tables—that supply the data. It’s a small word with a big job: it gives the rest of the query a source.

Consider a school database with a table called Students. It might contain columns such as Name, YearGroup and House. To display student names, you could write:


SELECT Name

FROM Students;

Here, SELECT names the column to show, while FROM names the table it comes from. The two parts work together. A request for a column without a data source is like asking for a page number without saying which book you mean.

SELECT picks the columns; FROM finds the table

It’s easy to mix up SELECT and FROM because they usually appear side by side. But they have different roles.

SELECT tells the database which columns to return. FROM tells it where to find those columns. In the example above, the database looks in Students and returns the values in Name.

You can ask for more than one column:


SELECT Name, House

FROM Students;

Or, when you need every column, use the asterisk:


SELECT *

FROM Students;

The asterisk means “all columns.” It can be handy while exploring a small dataset, though naming the columns you need often makes a query clearer. It also helps avoid pulling in extra data that the result doesn’t need.

The roles stay the same as queries grow. SELECT shapes the output; FROM sets its source. They’re a bit like choosing ingredients and naming the cupboard they’re in. One describes what you want; the other tells you where to find it.

A table is the starting point

A relational database stores related information in tables. Each table has rows, which hold individual records, and columns, which hold particular types of information. A Books table, for instance, might have columns for a title, author and publication year.

A query can use that table as its source:


SELECT Title, Author

FROM Books;

The database reads the rows in Books, then returns the requested columns. If the table contains 500 books, the result may contain up to 500 rows, depending on any conditions added to the query.

That last detail matters. FROM identifies the source, but it doesn’t usually decide which records appear. Other clauses handle that job. For example, WHERE filters rows:


SELECT Title, Author

FROM Books

WHERE PublicationYear < 1950;

This query still gets its data from Books. The WHERE clause narrows the results to books published before 1950. Each clause has its own role, and SQL becomes easier to read when those roles are kept distinct.

More than one table can be a source

Sometimes the information needed for a report sits across several tables. A school database might store student details in Students and course details in Courses. A separate table, such as Enrolments, can connect students to the courses they take.

SQL can bring these sources together using a join:


SELECT Students.Name, Courses.CourseName

FROM Students

JOIN Enrolments

ON Students.StudentID = Enrolments.StudentID

JOIN Courses

ON Enrolments.CourseID = Courses.CourseID;

The FROM clause begins with Students, and the JOIN clauses add the other tables. The ON conditions explain how their rows match. For example, a student’s ID connects a row in Students to the related row in Enrolments.

This is one reason a database is often split into several linked tables rather than keeping everything in one enormous sheet. Separate tables can reduce repeated information and make updates more reliable. A student’s name needn’t be copied into every course record; the database can connect the records through an ID.

There’s a small but important point here: FROM isn’t limited to naming one table. In a larger query, it introduces the data source, which may include joins and other parts of a data expression. The basic idea remains the same: the database needs to know where the query’s data comes from.

Reading a query in a useful order

SQL statements are often written in a familiar order:


SELECT column_name

FROM table_name

WHERE condition;

This order reads naturally: choose the output, name the source, then narrow the rows. Yet databases generally process a query in a different logical order. A simplified version is:

  1. Identify the source in FROM.

  2. Apply filters in WHERE.

  3. Group rows, if needed.

  4. Filter groups with HAVING.

  5. Choose the output with SELECT.

  6. Sort the result with ORDER BY.

This distinction can seem odd at first. You write SELECT before FROM, but the database needs the source data before it can build the result. Think of a librarian: you might say what information you want first, but the librarian still needs to locate the right catalogue or shelf before finding it.

The order also helps explain why column names can sometimes cause confusion. If two tables both contain a column called Name, writing just Name may be unclear. You can qualify it with the table name:


SELECT Students.Name

FROM Students;

In a query with several tables, this makes it easier to see exactly where each column comes from.

Table aliases keep longer queries tidy

When queries use several tables, repeating long table names can make the code harder to scan. SQL lets you assign a shorter alias:


SELECT s.Name, c.CourseName

FROM Students AS s

JOIN Enrolments AS e

ON s.StudentID = e.StudentID

JOIN Courses AS c

ON e.CourseID = c.CourseID;

Here, s, e and c stand for the three tables. The aliases don’t change the data or the query’s meaning; they just make references more compact.

Aliases are especially helpful when the same table appears more than once. Imagine a Staff table with a ManagerID column that refers back to another staff member. A query might compare one row in Staff with another. Short aliases make those two roles easier to distinguish.

What FROM doesn’t do

Because FROM names the data source, it can be tempting to think it controls the whole query. It doesn’t. It won’t, by itself, choose specific columns, filter records, or sort the result.

Those jobs belong to other clauses:

  • SELECT chooses columns or calculated values.

  • WHERE filters individual rows.

  • GROUP BY gathers rows that share a value.

  • HAVING filters those groups.

  • ORDER BY sorts the final result.

For example:


SELECT House, COUNT(*) AS StudentCount

FROM Students

GROUP BY House

ORDER BY StudentCount DESC;

The source is still Students. The query groups students by house, counts the rows in each group, and sorts the counts from largest to smallest. FROM provides the starting data; the other clauses shape what comes back.

That separation is useful beyond tidy code. If a result looks wrong, identifying each clause’s job gives you a sensible place to investigate. Did the query start from the right table? Is the filter too broad? Are the tables joined on the right columns? SQL errors can feel cryptic, but breaking the statement into roles often makes the issue less mysterious.

The little clause that gives a query its footing

FROM may be only one word, but it anchors an SQL query to its data. It names the table or source being queried, while SELECT specifies what to display. When several tables are involved, joins extend that source and connect related records.

Once that distinction clicks, SQL statements become easier to read. Start by spotting the source. Then look at the columns, filters and sorting rules. The query stops looking like a string of keywords and starts to read more like a set of instructions—each part doing one clear job.