โ† All Projects

SQL Practice Suite

SQL SQL Server Snowflake Spark SQL Analytics

Advanced SQL problems with worked solutions โ€” going well beyond GROUP BY into the patterns that actually come up in production data engineering and analytics work.

Overview

A lot of SQL practice resources stop at aggregations. This suite covers the harder patterns โ€” handling hierarchies, building slowly changing dimensions, writing queries that are both readable and performant at scale. Problems span ANSI SQL, T-SQL, Snowflake SQL, and Spark SQL. Every problem includes a worked solution and commentary on trade-offs between approaches.

๐ŸชŸ

Window Functions

RANK, DENSE_RANK, ROW_NUMBER, LAG/LEAD, running totals, NTILE โ€” applied to real analytical problems.

๐ŸŒณ

Recursive CTEs

Org chart traversal, bill of materials, category trees โ€” problems that require iterative or hierarchical logic.

๐Ÿ”„

SCD Patterns

Type 1, 2, and 3 slowly changing dimensions with merge logic, effective date ranges, and history tracking.

โšก

Query Optimisation

Execution plan analysis, index strategy, and partition pruning โ€” writing queries that hold up at enterprise scale.

Roadmap

โœ“ Done
Window functions & CTEs

Core problem set with worked solutions and commentary on performance trade-offs.

โœ“ Done
SCD Type 1, 2, 3 patterns

Merge-based SCD implementations in T-SQL and Snowflake SQL with full worked examples.

In Progress
Query optimisation section

Execution plan analysis and partition pruning problems with before/after performance comparisons.

Planned
Snowflake-specific features

FLATTEN, LATERAL, PIVOT, MATCH_RECOGNIZE, and Time Travel โ€” patterns unique to Snowflake's SQL dialect.

Planned
dbt model equivalents

Translating the SQL patterns into dbt models โ€” showing the SQL โ†’ dbt mapping for each problem type.