SQL

SQL is the common language of relational databases, warehouses and lakehouse engines. This hub links the site's SQL reference pages, performance guides and practice exercises, and suggests an order for working through them.

The SQL hub for language reference, query performance and optimizer tuning, and worked exercises. Use the cards below to jump into syntax fundamentals, plan-reading, join strategy, or interview-style practice problems.

SQL Reference & Practice

SQL Overview

Language fundamentals across DDL, DML, DCL, and TCL, plus syntax basics and the logical SQL execution model.

SQL Statements

Worked patterns for SELECT, INSERT, UPDATE, DELETE, and MERGE with concrete examples.

Query Performance

Reading EXPLAIN plans, index usage, table statistics, and hands-on techniques for tuning the optimizer.

Optimizing Joins

Join algorithms (hash, merge, nested-loop), join order, and how to avoid accidental cartesian products.

Practice — Top Products by Region

Worked SQL exercise using WINDOW functions and grouped ranking to find top items per region.

Practice — Multi-Table JOIN

Hands-on JOIN exercise across two tables, focused on key relationships and result shaping.

Related on this site

Cortex Analyst (Snowflake)

Text-to-SQL grounded in a YAML semantic model. The natural-language layer over a Snowflake warehouse, with a verified-query store for accuracy.

PySpark SQL Functions

PySpark's pyspark.sql.functions over Parquet — the SQL-style API for distributed transformations on Databricks.

PySpark Pivot Tables

Pivot/unpivot patterns in PySpark SQL — the distributed equivalent of CASE WHEN aggregations on a single-node DB.

Amazon Athena

Serverless SQL over S3 using Presto/Trino. The default query engine for S3-based data lakes — no provisioning, pay-per-scan.

Schema Design

Schema-design fundamentals: normalization vs. denormalization, naming conventions, and how schema choice drives query performance.

Normalization

1NF through BCNF — when to normalize for integrity and when to denormalize for analytical query speed.


About this section. The first four cards form the language and optimizer reference: SQL Overview and SQL Statements cover the syntax and statement patterns, while Query Performance and Optimizing Joins cover plan-reading and tuning. The last two cards are interview-style practice problems — short, self-contained exercises you can run end-to-end to drill window functions, grouped ranking, and multi-table joins.


1. How the pages fit together

Learning path Overview DDL, DML, DCL Statements SELECT, JOIN, CTEs Performance plans, indexes Join tuning join strategies Practice exercises

Start with the overview for the categories of SQL and the statements page for syntax. Once queries are correct, the performance pages explain how the optimizer turns SQL into an execution plan, how to read that plan, and how indexes, statistics and join algorithms (nested loop, hash, merge) affect run time. The practice pages apply all of this to interview-style problems such as top-N per group and multi-table joins.

2. Pick a page by task

If you need toGo to
Recall syntax for a statementSQL Statements
Understand DDL, DML, DCL and TCLSQL Overview
Speed up a slow queryQuery Performance
Fix an expensive joinOptimizing Joins
Practice window functions and rankingTop Products by Region
Practice joinsMulti-Table JOIN
Relational databasesSectionschemas and dimensional modelling Normalizationmodellingdesigning tables