Learn SQL interactively
Practice real SQL queries against actual databases. 74 exercises across three schemas — hospital, company, and school. No signup. No setup. Free forever.
Everything you need to learn SQL
▶ Run real queries
Execute SQL against in-browser SQLite databases. No server setup, no installs — just open the browser and write queries. See results instantly.
✓ Instant feedback
Your output is compared against the expected result row-by-row and column-by-column. Get precise feedback on exactly which cell differs if your answer is wrong.
◈ SQL to T-SQL translation
Write SQLite SQL in the editor, click Translate, and see the equivalent Microsoft SQL Server T-SQL. Learn the syntax differences between SQLite and SQL Server.
◆ Sandbox mode
Your own scratchpad. Write any SQL — CREATE TABLE, INSERT, UPDATE, DELETE — and see the changes persist. Reset the database anytime to restore seed data.
▶ Live SQL Server
Connect to your own SQL Server instance (or Azure SQL). Run real queries against production or development databases, with encrypted credential storage.
⊙ Schema explorer
Browse tables, columns, and foreign key relationships before writing queries. The schema panel shows you exactly what data is available to query.
Sample exercises
Frequently asked questions
Is SQL Query Lab really free to use?
Yes, SQL Query Lab is completely free. No signup, no account required. You open the app and start practicing SQL immediately.
What SQL topics can I practice?
SQL Query Lab covers SELECT statements, JOINs, GROUP BY, HAVING, subqueries, window functions, DML (INSERT, UPDATE, DELETE), and DDL (CREATE, ALTER, DROP). All 74 exercises span three real database schemas: hospital, company, and school.
Do I need to install anything?
No installation required. SQL Query Lab runs entirely in your browser. The SQL engine (sql.js) runs as WebAssembly, so all database operations happen client-side. For practice mode, no server is needed.
Can I connect to my own SQL Server database?
Yes. SQL Query Lab has a Live SQL Server mode where you can connect to your own SQL Server or Azure SQL instance. Credentials are encrypted server-side and never stored in the browser.
How does the feedback work?
After you run your query, SQL Query Lab compares your result set against the expected answer row-by-row and column-by-column. You'll see exactly which row or cell differs if your answer is incorrect. Correct answers are saved and your progress is tracked.