🇫🇷 Version française : LISEZMOI.md
A complete SQL interpreter running in your browser — no server, no dependency, one single HTML file.
User interface in French. Detailed documentation (French): sql_studio_doc.odt (LibreOffice Writer).
The embedded database is a small teaching database freely copied from the picture of a DGSE (French intelligence service) quiz. Three tables, natural joins, deliberate NULLs — everything needed to learn SQL without friction.
A teaching tool to learn and practise SQL, fully standalone. No Node.js. No Python. No CDN. No framework. Open the file in Firefox or Chrome — it is ready.
| Feature | Description |
|---|---|
| SQL engine | SQL interpreter in plain JavaScript, in-memory data |
| Table explorer | Columns, types and data preview; SELECT * and DROP buttons per table |
| Keyword palette | One-click insertion of keywords and functions, grouped by family |
| Editor | Run with the button or Ctrl+Enter |
| Training mode | 15 exercises over 10 levels, progressive hints and solutions, a lesson per level |
| Import / export | Import a CSV as a table, export the last result as CSV |
| Persistence | Database and progress kept in the browser's localStorage |
This is the centrepiece. A SQL interpreter written in plain JavaScript that runs real queries on real in-memory data.
Supported queries:
SELECTwith named columns,ASaliases,*SELECT DISTINCTFROMwith table aliasesINNER JOINandLEFT JOIN(withONand NULL handling)- Multiple joins (3 tables or more)
WHEREwithAND,OR,NOT,IN,NOT IN,BETWEEN,IS NULL,IS NOT NULL, operators=!=><>=<=CASE WHEN ... THEN ... ELSE ... ENDwith arithmetic (+)- Multi-column
ORDER BYASC/DESC LIMIT
Functions:
COALESCE,CONCATDATE,STRFTIME- Spatial:
ST_MakePoint(lon, lat),ST_X,ST_Y,ST_SRID,ST_GeometryType,ST_IsEmpty
Supported DDL/DML:
CREATE TABLEDROP TABLEINSERT INTO ... VALUESUPDATE ... SET ... WHEREDELETE FROM ... WHERE
What the engine does well:
NULLs are handled correctly. A LEFT JOIN on a NULL foreign key keeps the row with the right-hand columns set to NULL — exactly like a real DBMS. CASE WHEN scoring adds several expressions cleanly. Table aliases are resolved in ON and WHERE conditions without ambiguity.
15 progressive exercises over 10 levels:
| Level | Topic | Questions |
|---|---|---|
| 1 | SELECT | 1 |
| 2 | WHERE | 1 |
| 3 | AND / OR / IS NULL | 1 |
| 4 | DISTINCT · ORDER BY | 2 |
| 5 | INNER JOIN | 2 |
| 6 | LEFT JOIN | 2 |
| 7 | 3 tables | 2 |
| 8 | CASE WHEN | 2 |
| 9 | INSERT | 1 |
| 10 | CREATE TABLE | 1 |
Checking is done on the result, not on the syntax. Two different queries giving the same output are both accepted.
Levels 4 to 8: after 5 errors → hint. After 10 errors → solution + the question rephrased differently.
Progress is saved in localStorage — it survives a reload.
Each level has a lesson bubble (💡 button) with examples.
- ⬇ démo: loads the DGSE database (3 tables)
- ↑ CSV: imports any
.csvfile as a new table, types detected automatically - ↓ CSV: exports the result of the last SELECT query
- ✕ reset: clears everything
Open the link above, or download sql_studio.html and open it in a browser.
No installation. No server. Works offline.
| Version | Change |
|---|---|
| 2.1 | Published version: SQL engine, Training mode, CSV import / export |
| 2.2 | Old copy pasted at the end of the file removed (duplicated interface and script) |
| 2.3 | AZS visual identity (slate / amber / cyan palette, AZS mark linking back to www.azs.fr, system fonts); stacked layout on small screens |
Free of rights. Copy, modify, redistribute.
