SQL guides
Read one, then practice it in the editor.
Start here
- SQL JOINs Explained INNER, LEFT, RIGHT, FULL OUTER, CROSS and self-joins on a small company database, with the rows each one returns.
- NULL Handling in SQL Master NULL handling in SQL: IS NULL, COALESCE, IFNULL, NULLIF, string concatenation with NULLs, three-valued logic, and aggregate functions with NULLs.
Go further
- CTEs and Subqueries Explained Understand SQL CTEs, subqueries, correlated subqueries, and recursive CTEs with practical examples. Learn when to use each pattern and how they compare to views and temp tables.
- SQL Window Functions Master SQL window functions: ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, running totals, moving averages, NTILE, and FIRST/LAST_VALUE.
Design and speed
- Database Normalization Understand database normalization from first principles: 1NF, 2NF, 3NF, and BCNF with real-world examples, trade-offs, and guidance on when to denormalize intentionally.
- SQL Indexing and Query Performance Learn how SQL indexes work, what makes a query sargable, when to use composite vs covering indexes, and how to read execution plans.
- SQL Best Practices From formatting and naming conventions to indexing strategy and query optimization — a practical guide to writing SQL that your team can read, maintain, and that performs in production.