Learn SQL with Real Databases,
Not Toy Examples.
Run real SQL queries on 8 connected business tables, solve interview-style challenges, and build job-ready SQL skills directly in your browser. 100% free, with no paid plan.
- ✓ 100% Free
- ✓ No Signup Required
- ✓ Real SQL Engine
- ✓ Instant Results
| status | orders |
|---|
Lessons, Challenges and a Database to Run Them On.
The practice database is a small online store: customers, orders, products, payments, reviews and the company's own employees and departments. Every lesson example and challenge runs against it.
Built for Everyone Learning SQL.
Students
Start from your first SELECT, with every example runnable on the same 8 tables.
Data Analysts
Practise reporting queries: monthly revenue, top-N per group, running totals, retention.
Business Analysts
Turn a business question into a query one clause at a time, and check the numbers.
Data Scientists
Get comfortable with joins, window functions and CTEs before you reach for pandas.
Software Engineers
Refresh JOINs, indexes and transactions, with notes on where MySQL, PostgreSQL and SQL Server differ.
Interview Prep
Classic interview tasks with expected output, a model solution and an explanation.
Master the Most Important SQL Topics.
15 of the 43 lessons, each with worked examples and a quiz. See all 43 lessons →
SELECT
The foundation of every SQL query.
WHERE
Filter rows with precise conditions.
ORDER BY
Sort results the way you need them.
GROUP BY
Roll rows up into summarized groups.
HAVING
Filter aggregated group results.
JOINS
Combine data across multiple tables.
CASE WHEN
Add conditional logic to your queries.
Aggregate Functions
COUNT, SUM, AVG, MIN, MAX explained.
String Functions
Clean, format, and manipulate text data.
Date Functions
Work confidently with dates and time.
Subqueries
Nest queries inside other queries.
CTEs
Write clean, readable multi-step queries.
Window Functions
Rankings, running totals, and more.
Views
Save and reuse queries as virtual tables.
Indexes
Understand how databases stay fast.
Follow a Clear SQL Learning Path.
- 1
SELECT Fundamentals
Query your first table and shape the output.
- 2
Filtering with WHERE
Narrow results down to exactly what you need.
- 3
Sorting with ORDER BY
Control the order rows come back in.
- 4
Aggregations & GROUP BY
Summarize data into meaningful totals.
- 5
SQL JOINs
Combine related tables into one result.
- 6
Advanced SQL Concepts
Subqueries, CTEs, and CASE WHEN logic.
- 7
Window Functions
Rankings, running totals, moving averages.
- 8
Real SQL Challenges
Apply everything on interview-style problems.
- 9
Interview Preparation
Walk into your SQL interview job-ready.
What You Get on SQLab Hub.
One Database for Everything
A store with customers, orders, products, payments, reviews and staff: 8 related tables of generated data, documented column by column.
Instant Query Execution
Run SQL directly in your browser with no setup.
Challenges With Answers
Each challenge shows the expected output and the model solution, so you can check your work.
Browser-Based Learning
No installation required, ever.
Beginner to Advanced
From SELECT and WHERE to window functions, gaps-and-islands and median calculations.
100% Free
Lessons, Playground, challenges, projects and tests are all free. No paid plan.
Practising vs. Only Reading.
| SQLab Hub | Read-only article | |
|---|---|---|
| Explains the syntax | ✓ | ✓ |
| Works in the browser, no install | ✓ | ✓ |
| A database you can query | ✓ | — |
| Run and edit every example | ✓ | — |
| Results come from your own query | ✓ | — |
| Practice tasks with expected output | ✓ | — |
Before You Start.
Is SQLab Hub free to use?
Yes, SQLab Hub is 100% free. The lessons, the SQL Playground, every challenge, the projects and the skill tests cost nothing, and there is no paid plan and nothing to buy. You can read every lesson, run queries and see every challenge solution without an account; a free account is needed only to save queries, track progress across devices and take the timed tests. The site is paid for by advertising.
What SQL dialect does SQLab Hub use?
Queries run on SQLite. Standard SQL such as SELECT, JOIN, GROUP BY, CTEs and window functions works as written. Where MySQL, PostgreSQL or SQL Server differ, for example in date functions, the lessons show each syntax.
What can I run in the SQL Playground?
Read-only queries: statements that start with SELECT or WITH. The practice database is shared, so INSERT, UPDATE, DELETE and CREATE are not accepted. Lessons on topics like indexes, transactions and triggers explain those statements with examples instead.
Can I use SQLab Hub for SQL interview preparation?
Yes. The challenges include common interview tasks such as the Nth highest salary, finding duplicates, running totals and top-N per group, and there is a page of SQL interview questions with worked answers.
SQLab Hub is built and maintained by Rahul Kumar. About the site and how the content is made.
Stop Reading About SQL.
Start Writing It.
Open the Playground, run a query, and change it until you understand why the result looks the way it does.