liveBook · Manning

From clause

As explained in DuckDB in Action

The FROM clause specifies the relations that provide the input data for a SQL query.

The FROM clause specifies the table or other relation supplying input data for the rest of a SQL query. It works with SELECT, WHERE, GROUP BY, and JOIN to filter and reshape that input. section 3.4.4

Listing 3.10 The structure of a SELECT statement
SELECT select_list
FROM tables
WHERE condition
GROUP BY groups
HAVING group_filter
ORDER BY order_expr
LIMIT n

Use the clause order as a compact map: identify sources with FROM, then filter, group, order, and limit results. section 3.4.4

Read and combine data

Start with a bounded read: SELECT * FROM prices LIMIT 2;. Add a predicate with FROM prices WHERE valid_from BETWEEN '2020-01-01' AND '2020-12-31';. Sources can also be inline VALUES relations, subqueries, common table expressions, or files. JOIN combines sources: an inner join keeps matching keys, while left and full outer joins preserve unmatched rows. section 3.4.4

How DuckDB in Action covers it

How deep it goes
Explains tables, inline values, subqueries, CTEs, joins, and recursive sources, but defers full SELECT reference details.
Examples
Demonstrates prices, VALUES relations, grouped readings, file joins, subqueries, CTEs, and recursive parent-child paths.
What it assumes
Assumes basic SQL query intent while establishing how SELECT and FROM divide returned columns from input data.
What you can do after
Apply it to read tables, filter inputs, combine relations, and build larger analytical queries.
How it connects
Connects FROM to SELECT, JOIN, WHERE, GROUP BY, subqueries, common table expressions, and recursive SQL.

Also explained in

Compare how 3 books explain from clause →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.