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


