Speedy SQL is an easily deployable platform for teaching SQL. It runs entirely on your browser and is built with Jekyll, meaning that anyone could easily deploy their own version of Speedy SQL. All they need to do is fork the repository, deploy it on GitHub pages, and write a few Markdown files to deploy their own set of questions!
Yep! Speedy SQL is actually running a WebAssembly port of SQLite called sql.js. I came across sql.js while I was trying to port a C++ compiler for a similar project to Speedy SQL using Emscripten. Since I was taking a database course at that time, I decided to just go ahead and make Speedy SQL first while my memory of the course is still fresh.
As for how Speedy SQL saves your queries and keeps track of the questions you've solved, everything is stored in your browser's local storage.