Skip to content
QueryLab

SQL practice in the browser

Learn SQL by solving real-world challenges.

Practice SQL in your browser with instant feedback, realistic datasets, hints, and step-by-step explanations.

QueryLab is for students, analysts, and anyone preparing for a SQL interview. You can run queries and check answers without creating an account.

Products still on the shelfBeginner · 8 min

List every product Northwind can still sell, with price and remaining stock.

Starter query

-- Return columns: id, name, category, price_cents, stock
SELECT

FROM products

Expected result · 7 rows

First rows of the expected result for Products still on the shelf
idnamecategoryprice_centsstock
8Ceramic MugHome180050
2Desk LampHome425040

How it works

  1. Step 1

    Choose a challenge

    Pick a topic and a business question. Each one names the tables and the result you need.

  2. Step 2

    Write SQL in the browser

    Use the editor with syntax highlighting. Your query runs on a sample database that resets every time.

  3. Step 3

    Get instant feedback and learn

    See a clear error, or compare columns, row counts, and values. Hints stay optional.

Featured exercise categories

Why QueryLab

No installation

The sample database runs in your browser. Nothing to install and nothing to connect.

Instant validation

QueryLab compares column names, row counts, and values after each check.

Realistic datasets

Questions come from commerce, HR, SaaS, logistics, marketing, finance, and healthcare tables.

Hints and explanations

Open one hint at a time. The explanation appears after a correct result, and the full solution stays hidden until you ask.

Progress tracking

Completed exercises stay on this device. Create an account when you want them on another browser.

Interview preparation

Timed sets and a five-question mock sit next to the open practice catalog.

Sample challenge

List every product Northwind can still sell, with price and remaining stock.

Business question

Products still on the shelf

Merchandising is building a restock board. Out-of-stock items and products that have not been received yet should stay off the list.

products

  • id INTEGER · primary key
  • name TEXT
  • category TEXT
  • price_cents INTEGER
  • stock INTEGER · nullable

Starter query

-- Return columns: id, name, category, price_cents, stock
SELECT

FROM products

Expected output

First three expected rows for Products still on the shelf
idnamecategoryprice_centsstock
8Ceramic MugHome180050
2Desk LampHome425040
3Noise-canceling HeadphonesElectronics1890015

First 3 of 7 rows.

What you can count on

80
Exercises you can run today
15
SQL topics, from filters to window functions
8
Business datasets with realistic rows
Free to start
No payment and no trial wall
No installation required
SQLite runs in the browser
Beginners and job seekers
Open practice plus a timed interview mode

FAQ

Is QueryLab free?
Yes. Every exercise, hint, and interview set is free to start. There is no payment step.
Do I need to install a database?
No. Each query runs in SQLite inside your browser. The application database only stores accounts and saved progress.
Can I practice SQL without an account?
Yes. You can open an exercise, run SQL, and check the answer immediately. Progress stays in this browser until you create an account.
What SQL topics are covered?
SELECT, WHERE, ORDER BY, LIMIT, DISTINCT, NULL handling, JOINs, GROUP BY, HAVING, subqueries, CTEs, window functions, dates, CASE, and data cleaning.
Is QueryLab good for SQL interview preparation?
It is built for that practice. You can work through interview-style questions or start a timed set. It does not promise a job or a score on a particular company's test.
Which databases are supported?
The sandbox is SQLite. SELECT, JOIN, GROUP BY, and window functions match the SQL you will write for MySQL and PostgreSQL. Date and string functions differ, and the MySQL and PostgreSQL pages call those differences out.

Start solving SQL challenges today.

Open a beginner exercise, write a query, and check the result. An account is optional.