r/SQL • • 4d ago

Discussion I built a free, open-source interactive guide to SQL & Database Internals with an in-browser WASM SQLite 3 workbench

Hi everyone,

I wanted to share a free, open-source project I've been building called SQL in Depth, aimed at going beyond basic SQL syntax into database internals from first principles.

Live site: https://sql-in-depth.vedgupta.in

GitHub repo: https://github.com/innovatorved/sql-in-depth

What's included:

- 180 structured units covering relational theory, indexing, storage engines, query planning/execution, transactions, and concurrency

- 36 interactive simulators to visualize how database internals actually behave

- An in-browser WASM SQLite 3 Workbench so you can run queries and experiment directly without local setup

- A Table-Level Relational Visualizer to inspect joins, filtering, and relational operations step by step

Everything is free, open-source, and runs directly in the browser. I'd really appreciate any feedback from the r/SQL community — especially on topics that could go deeper, edge cases in the simulators, or anything that could be made clearer.

15 Upvotes

5 comments sorted by

2

u/mirinai_ai 3d ago

Nice scope. Going by the topic list, a few areas that trip people up in real work and don't seem to have their own unit, unless I missed them:

Dates and time zones: timestamp vs timestamptz in Postgres, the fact that SQLite has no date type and stores dates as text or numbers, why grouping by day gives different totals depending on the session time zone, and days that are 23 or 25 hours long around daylight saving changes.

Differences between the two engines you already ship. SQLite will store 'abc' in an INTEGER column unless the table is declared STRICT, and LIKE is case-insensitive for ASCII in SQLite but case-sensitive in Postgres. Since the workbench has both, a mode that runs the same query on each and highlights where the results differ could be a useful exercise in itself.

Collation and text comparison more generally: case and accent sensitivity, how sort order changes with the collation, and why a unique constraint can still allow both 'Smith' and 'smith'.

0

u/innovatorved 3d ago

Thank you so much for this super practical list — every single one of these is a classic real-world footgun!

Dates/timezones & DST transitions (23/25-hour days, `timestamp` vs `timestamptz`, and session-timezone grouping drift) definitely deserve their own dedicated unit and interactive simulator.

I also love the idea of a side-by-side SQLite vs Postgres behavioral diff mode in the workbench — highlighting things like SQLite's type affinity without `STRICT` tables, ASCII case-insensitive `LIKE` vs Postgres's case-sensitive `LIKE`, and collation/text-comparison quirks (`Smith` vs `smith` under unique constraints & sort orders).

Adding these to my roadmap — really appreciate you taking the time to look through the curriculum and share such sharp feedback!

1

u/mirinai_ai 16h ago

Glad it's useful. If the diff mode happens, NULL ordering is another easy one to show: SQLite puts NULLs first in an ascending sort and Postgres puts them last, so the same ORDER BY can come back in a different order. SQLite will also let you select a column that isn't in the GROUP BY and quietly picks a value from one of the rows, where Postgres refuses unless you grouped by the primary key.

1

u/h4xz13 3d ago

This is pretty cool! I had built something similar with Postgres in the browser for teaching SQL. pgsql.sequel.sh

0

u/innovatorved 3d ago

Thanks so much! Running Postgres right in the browser for teaching SQL is awesome — I'm definitely going to check out `pgsql.sequel.sh`. Getting zero-setup SQL engines running client-side really removes so much friction for learners. What was the trickiest part of building it?