Loading topic
SELECT queries with WHERE and ORDER BY, join related tables, and group rows with GROUP BY and aggregate functions such as SUM and COUNT. Familiarity with subqueries helps, but the examples explain the important parts.3 min readSELECT, WHERE, JOIN, GROUP BY, and aggregate functions such as SUM and COUNT. You should also be comfortable reading a nested subquery.2 min readSELECT, WHERE, JOIN, GROUP BY, aggregate functions, and basic subqueries. This chapter uses PostgreSQL syntax for date_trunc; other databases may use a different function for grouping dates by month.2 min readSELECT, WHERE, JOIN, GROUP BY, and aggregate functions such as SUM. This chapter also assumes you have seen a subquery. A common table expression (CTE) is a named query result that exists only while one SQL statement runs.2 min readSELECT, joins, WHERE, and basic CTE syntax. You should also understand that a table can contain rows that point to other rows, such as employees pointing to managers.3 min readSELECT, joins, UNION ALL, and basic common table expressions (CTEs). This chapter focuses on recursive CTEs that walk sequences, trees, and graphs. The central rule is simple: every recursive query needs a clear stopping condition.3 min readmanager_id that points to another employee. A product category tree works the same way: a category has a parent_id that points to another category.2 min readSELECT, JOIN, WHERE, GROUP BY, and basic subqueries. You should also understand that a common table expression (CTE) exists only for the statement that contains its WITH clause.3 min readSELECT, joins, aggregates, and basic CTE syntax. It focuses on execution behavior: what a database does with a CTE after it parses the query.3 min readINSERT, UPDATE, DELETE, SELECT, and WITH syntax. It focuses on PostgreSQL behavior, which differs from many other SQL databases.2 min readSELECT, WHERE, JOIN, GROUP BY, aggregates, and basic subqueries. This chapter focuses on choosing and checking CTEs rather than learning their basic syntax.3 min read