Basics
- Hello, SELECT β Selecting constants and a first query.
- Columns & Aliases β Selecting specific columns, aliasing, schema-qualified names.
- WHERE Filters β Common predicates, BETWEEN/IN/LIKE/IS NULL and sargability notes.
- ORDER BY & TOP β Sorting, TOP, WITH TIES, NULLS LAST workaround.
- CASE Expressions β Simple vs searched CASE, default branch, common patterns.
- NULLs & 3-Valued Logic β NULL behavior, COALESCE/ISNULL, comparisons and pitfalls.
- π§ DISTINCT & Deduping β Use DISTINCT and ROW_NUMBER to remove duplicates.
- π§ Subqueries β Scalar, correlated, and table subqueries.
- π§ EXISTS vs IN β Compare semi-joins with EXISTS and IN.
- π§ CTEs β Common Table Expressions, basic and recursive.
- π§ Set Operators β UNION, INTERSECT, and EXCEPT patterns.
- π§ CROSS JOIN & Self Join β Cartesian products and self-joins.