SQL

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.