A local SQL trainer that runs in your browser. Practice real queries on a real database, no sign-up, no cloud.
git clone https://github.com/burgano/SQL-query-practice.git
cd sql-query-practicemacOS / Linux:
bash run.shWindows:
run.batThe script sets everything up automatically and opens the browser. No manual installation needed.
To stop the server use the Stop server button inside the app.
- Requires Python 3.8+ — python.org
- Creates a virtual environment, installs dependencies, starts the server
- Browser opens automatically at
http://localhost:<port> - Port 5000 may be taken by AirPlay Receiver → the script finds the next free port automatically
- To disable AirPlay: System Settings → General → AirDrop & Handoff → AirPlay Receiver → Off
- Or specify a port manually:
PORT=8080 bash run.sh
- Requires Python 3.8+:
sudo apt install python3 python3-venvis installed automatically if missing (requiressudo)- If the project is on an NTFS/exFAT drive (no symlink support), the virtual environment is created in
~/.local/share/sql-query-practice-venvinstead - Browser opens automatically via
xdg-open(requires a desktop environment)
- Python is installed automatically if not found (via winget or direct download from python.org)
- Virtual environment and dependencies are set up automatically
- Browser opens automatically
- Port is selected automatically starting from 5000
5 related tables with realistic data:
| # | Table | Description |
|---|---|---|
| 1 | users |
25 users from different cities |
| 2 | orders |
40 orders |
| 3 | products |
20 products |
| 4 | returns |
12 returns |
| 5 | service_requests |
18 support tickets |
130 exercises covering:
SELECT / WHERE / ORDER BY / LIMITAND / OR / IN / NOT IN / LIKE / BETWEEN / IS NULLCOUNT / SUM / AVG / MIN / MAXGROUP BY / HAVINGJOIN / LEFT JOINROUND / COALESCE / LOWER / concatenationCASE WHEN- Subqueries
INSERT / UPDATE / DELETE- Multi-table JOINs (3, 4, 5 tables)
- Choose SQL dialect: SQLite, MySQL or PostgreSQL
- Sequential or random exercise order
- 1 to 5 tables depending on what you want to practice
- Hint system hidden behind a button
- Reveal answer on demand
- Answer checked by comparing actual query results, not strings
- DML exercises reset the data before each check
Python 3.8+ / Flask / SQLite / CodeMirror / Vanilla JS
sql-query-practice/
├── app.py
├── database.py
├── exercises.py
├── run.sh
├── run.bat
├── assets/
├── static/
│ ├── style.css
│ └── script.js
└── templates/
├── welcome.html
├── trainer.html
└── complete.html

