Applied Logic & Computing · Pure-C# SQL Engine & B-Tree Planner

SQL & Relational Data Observatory

Master production SQL from SELECT fundamentals to query optimization across 10 observatory towers: 3-valued NULL & NOT IN pitfalls, LEFT/self joins, GROUP BY & HAVING, set operators, window functions & ROWS BETWEEN frames, WITH RECURSIVE trees, sandboxed DML with FK/CHECK guards, and B-Tree leftmost-prefix EXPLAIN tuning.

  • Pure-C# SQL Engine + 4,096 Rows
  • 9-Stage Painter2D Visualizer
  • Window Frames & Recursive CTEs
  • Live B-Tree EXPLAIN Planner
Practice Towers
10
Guided Floors
40
Crown Rooms
10
Verification
Live Engine

What You Will Practice

Every query executes against the 8-table Nousfarer Archive (including a 4,096-row indexed catalog) inside a zero-dependency pure-C# SQL engine, lighting up a 9-stage Painter2D relational visualizer (Filter, Join, SemiJoin, Group, Venn SetOp, Window, Recursive Tree, DML Guard, and B-Tree Prism).

Inspect the live execution pipeline bar and interactive Schema Explorer to see why a SARGable covering index runs orders of magnitude faster than a full scan.

  • Filtering, 3-valued NULL logic, NOT IN poisoning, and correlated EXISTS/NOT EXISTS
  • INNER/LEFT/self joins, GROUP BY/HAVING aggregates, and UNION/INTERSECT/EXCEPT
  • Window functions (LAG, LEAD, RANK, DENSE_RANK, NTILE, FIRST_VALUE) & ROWS BETWEEN
  • WITH RECURSIVE hierarchies, sandboxed INSERT/UPDATE/DELETE constraints, and B-Tree EXPLAIN tuning

Course Curriculum (10 Towers · 40 Interactive Floors)

  1. Tower 1

    Tower 1 · Querying, Filtering & Sorting

    Master SELECT projections, DISTINCT, precision WHERE filters (IN, BETWEEN, LIKE), three-valued NULL & COALESCE, and multi-column ORDER BY + LIMIT.

    1. SELECT, Aliases & DISTINCT
    2. Precision WHERE Filters
    3. NULL Semantics & COALESCE
    4. Multi-Column ORDER BY & LIMIT
  2. Tower 2

    Tower 2 · Multi-Table JOINs

    Weave relational tables together with INNER JOIN, LEFT JOIN, IS NULL anti-joins, 3-table chains, and self-joins.

    1. INNER JOIN Key Threading
    2. LEFT JOIN & Unmatched NULLs
    3. The Anti-Join (LEFT JOIN + IS NULL)
    4. 3-Table Chains & Self-Joins
  3. Tower 3

    Tower 3 · GROUP BY & Aggregations

    Stack rows into GROUP BY buckets, filter aggregates with HAVING, dodge the LEFT JOIN COUNT(*) trap, and build CASE WHEN pivot reports.

    1. GROUP BY & Core Aggregates
    2. WHERE vs. HAVING
    3. The LEFT JOIN COUNT(*) Trap
    4. Conditional Aggregation (CASE Pivot)
  4. Tower 4

    Tower 4 · CTEs & Window Functions

    Write dynamic subqueries, readable WITH CTE pipelines, ROW_NUMBER() per-partition rankings, running totals, and the Chief Archivist Audit.

    1. Dynamic Scalar Subqueries
    2. Readable Pipelines With WITH (CTEs)
    3. Ranking Windows (ROW_NUMBER)
    4. Running Totals (SUM OVER ORDER BY)
  5. Tower 5

    Tower 5 · Self-Joins & EXISTS

    Join a table to itself, run correlated EXISTS semi-joins, dodge the notorious NOT IN + NULL trap, and filter rows against per-group correlated subqueries.

    1. Self-Joining Hierarchical Tables
    2. Correlated Semi-Joins With EXISTS
    3. Defusing the NOT IN + NULL Trap
    4. Correlated Scalar Subqueries
  6. Tower 6

    Tower 6 · Set Algebra & Pivots

    Combine queries vertically with UNION, UNION ALL, INTERSECT, and EXCEPT on the live Venn combiner, and safeguard analytical ratios with NULLIF.

    1. Deduplicated UNION Across Tables
    2. Tagged Ledgers With UNION ALL
    3. Set Difference With EXCEPT
    4. Safe Ratios With NULLIF
  7. Tower 7

    Tower 7 · Time-Series Windows

    Master LAG/LEAD period deltas, tie-aware RANK/DENSE_RANK/NTILE, sliding ROWS BETWEEN moving averages, FIRST_VALUE baselines, and the classic Gaps & Islands Crown!

    1. Period-Over-Period Deltas With LAG
    2. Tie-Aware Ranking (RANK, DENSE_RANK, NTILE)
    3. Rolling 3-Day Moving Average (ROWS BETWEEN)
    4. Baselines & Lookahead (FIRST_VALUE & LEAD)
  8. Tower 8

    Tower 8 · Recursive CTEs

    Generate sequences, fill missing calendar days, walk arbitrary-depth mentorship trees, build root-to-leaf path strings, and aggregate recursive generations.

    1. Recursive Sequence Generator
    2. Calendar Gap-Filling With LEFT JOIN
    3. Traversing the Mentorship Lineage Tree
    4. Root-to-Leaf Lineage Path Strings
  9. Tower 9

    Tower 9 · Constraints & DML

    Mutate sandboxed archive tables with INSERT, UPDATE, and DELETE while satisfying live PRIMARY KEY, FOREIGN KEY, UNIQUE, and CHECK integrity constraints.

    1. Safe INSERT & Foreign Key Integrity
    2. Scoped UPDATE & CHECK Constraints
    3. Safe DELETE & Referential Guards
    4. UNIQUE Keys & Clean Entity Inserts
  10. Tower 10

    Tower 10 · Indexes & EXPLAIN

    Inspect live EXPLAIN plans over the 4,096-row archive_catalog, master composite B-Tree leftmost-prefix seeks, rewrite non-SARGable filters, and hit Covering Index Seeks!

    1. Reading EXPLAIN: Full Scan vs. B-Tree Seek
    2. Composite Index Leftmost-Prefix Rule
    3. SARGable Rewrites (Unwrap Indexed Columns!)
    4. Covering Index Seeks (Index-Only Reads)

Deterministic Verification & Crown Payoff

Exact Result-Set, Constraint-Guard & EXPLAIN Plan Verification

Verifies exact row/column output, NULL semantics, PK/FK/UNIQUE/CHECK constraint safety, and live B-Tree index usage / SARGability on query-tuning floors.

Supported inputs: Interactive SQL Editor · 9-Stage Relational Visualizer · Schema Explorer · EXPLAIN

Crown Room payoff: Author recursive hierarchy queries, guard relational integrity, and optimize slow scans into covering index lookups across 10 Observatory Crowns.

Practice SQL & Relational Data Inside Nousfarer

Land directly on the SQL & Relational Data Observatory planet inside Nousfarer to climb all 10 interactive towers right in your browser.

Frequently Asked Questions

How does SQL & Relational Data verify my work?

Verifies exact row/column output, NULL semantics, PK/FK/UNIQUE/CHECK constraint safety, and live B-Tree index usage / SARGability on query-tuning floors. Every floor runs deterministically in your browser with immediate feedback — no video pausing or guesswork.

How much content is included in SQL & Relational Data?

The planet spans 10 progressively richer towers (40 guided floors plus 10 Crown Room capstones), paired with Ship Owl spaced-repetition recall whenever you want to sharpen a tricky concept.

What equipment or setup do I need to play SQL & Relational Data?

Everything runs directly inside your browser inside Nousfarer with zero plugins required. Supported inputs: Interactive SQL Editor · 9-Stage Relational Visualizer · Schema Explorer · EXPLAIN.