An interactive SQL learning game built on real Twitch chat data.
Three tools in one app:
- Block Game — drag SQL blocks to answer 15 questions (beginner → advanced)
- SQL Sandbox — write and run any SELECT query against the real dataset
- Data Explorer — Excel-style interface that shows the SQL it generates
By default uses Vedal987's Twitch chat data (~248k messages across 7 VODs).
You can use any Twitch channel — just change TWITCH_CHANNEL in config.py
and run seed.py with any VOD IDs from that channel.
To find VOD IDs: go to twitch.tv/[channel]/videos, click any VOD,
and copy the number from the URL: twitch.tv/videos/[VOD_ID]
Requirements: Python 3.12+, MySQL
# 1. Clone and install
git clone https://github.com/YOUR_USERNAME/query-wars
cd query-wars
python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# 2. Create MySQL database
mysql -u root -e "CREATE DATABASE vedal_chat;"
# 3. Set up tables
python database.py
# 4. Seed with Twitch VOD chat (edit VODS list in seed.py first)
python seed.py
# 5. Run
python main.pyThen open http://localhost:8003
In config.py:
TWITCH_CHANNEL = "vedal987" # change to any public channelIn seed.py, update the VODS list with VOD IDs from your chosen channel:
VODS = [
'2779925086', # replace with your VOD IDs
]Any public Twitch channel works — the seed script uses Twitch's public GQL API, no authentication required.
| Question | Concept |
|---|---|
| 1-5 | SELECT, COUNT, GROUP BY, ORDER BY, LIMIT, LENGTH() |
| 6-10 | HAVING, COUNT(DISTINCT), AVG, subqueries |
| 11-15 | CTEs (WITH), RANK(), ROW_NUMBER(), PARTITION BY, window functions |
Python 3.12 · FastAPI · MySQL · Vanilla JS