SQL Playground

1 language
  • Article
  • Read
From Wikipedia, the free encyclopedia
This article is about the interactive demo. For the search engine that hosts it, see David's Internet.
SQL Playground
TypeInteractive demo
OriginDTU Databases course
DeveloperDavid
Written inSQL (MariaDB), SQLite, sql.js (WASM), TypeScript
TestsEvery query preset fixture-tested against Python sqlite3
Built withDTU Databases weekly answer sheets and schemas, translated to SQLite
Hosted onDavid-Internet/demos/sql
Websitehttps://david-internet.vercel.app/demos/sql

SQL Playground is an interactive demonstration of five databases from a DTU Databases course, running entirely in the browser.[1]Schemas were translated from MariaDB to SQLite at build time. sql.js runs SQLite compiled to WebAssembly, so there is no server.

A schema browser draws tables and foreign keys beside hand-drawn ER designs. A query runner fires the weekly answer queries, or a visitor's own SQL, and highlights involved tables and touched rows.

Overview

The five course databases are the Silberschatz University schema, a Family warm-up, a Cinema exam set, and the week 12 and 13 Takeaway and Bus Service sets. A reconstructed bike-shop schema supports the modification panel.

Query runner

Forty-four presets cover joins, left joins, group-by-having, correlated subqueries, and the cinema exam's nine answers. MariaDB-only features are adapted and disclosed per preset. A modification panel replays INSERT, UPDATE, and DELETE with undo, a foreign-key toggle, and a trigger rewritten from SIGNAL to RAISE.

Development

Every query preset fixture-tested against Python sqlite3. The engine is client-side so a static export of David's Internet can host the lab.

See also

References

  1. ^ content/sql/README.md, David's Internet.