CodeRang
Where to start

Learn SQL Online

Learn SQL online through a structured sequence instead of collecting unrelated tutorials. SQL Arena courses combine short theory with a browser-based task in every lesson, and the first chapters are available free.

Updated · SQL Arena team

What you will practice

  • SQL fundamentals from zero
  • Practice after each lesson
  • Multiple SQL dialects
  • Query performance analysis
  • Analytics and data engineering topics

A practice problem in the trainer

This is how a problem looks in SQL Arena: the task, the editor, the result and the database schema.

PrevNextRandom
TaskSubmissionsAI Mentor
List free lessons from active courses

Use the courses and lessons tables. Return only free lessons that belong to active courses. Show the course title as course, lesson title as free_lesson, and course level as level. Sort by course title and then lesson id.

Query 1PostgreSQLv16
SELECT c.title AS course,
       l.title AS free_lesson,
       c.level
FROM courses c
JOIN lessons l ON l.course_id = c.id
WHERE c.is_active = TRUE
  AND l.is_free = TRUE
ORDER BY c.title, l.id;
Submit
Resultcourseslessons
Answer accepted

How this query works

The courses table stores one row per course, while lessons stores individual lessons. lessons.course_id points to courses.id, so JOIN connects each lesson to its parent course. After the join, a row contains information from both sides of that relationship.

The WHERE clause applies two requirements. c.is_active = TRUE removes an archived course, while l.is_free = TRUE keeps only lessons available in the free part. The SELECT list uses readable aliases because course and free_lesson describe the result better than repeating the source column names.

ORDER BY c.title, l.id makes the output deterministic. Courses are sorted alphabetically and lessons within the same course follow their ids. This is a small example, but it demonstrates the workflow you need throughout a SQL course: understand the tables, identify the relationship, apply the task conditions, and verify the result.

SQLPostgreSQL v16
SELECT c.title AS course,
       l.title AS free_lesson,
       c.level
FROM courses c
JOIN lessons l ON l.course_id = c.id
WHERE c.is_active = TRUE
  AND l.is_free = TRUE
ORDER BY c.title, l.id;
Query result
coursefree_lessonlevel
BigQuery FoundationsArraysintermediate
JSON in SQLJSON Valuesintermediate
Query PerformanceReading EXPLAINadvanced
SQL BasicsFirst SELECTbeginner
SQL BasicsFiltering Rowsbeginner

Common mistakes when learning SQL

01

Watching lessons without writing queries

Syntax can look familiar after a video or article, but recognition is different from recall. A useful SQL course should regularly make you write the query yourself.

02

Starting with an advanced specialization

Performance tuning, ClickHouse, BigQuery, and data engineering become much easier after basic filtering, joins, and aggregation are comfortable. Otherwise you are learning SQL fundamentals and platform-specific behavior at the same time.

03

Following a course without extra practice

A course gives you sequence and explanation, but additional exercises help turn concepts into reusable skills. Mix guided lessons with independent problems where the required SQL construct is not given away.

10 SQL Arena courses

All courses

SQL Arena currently includes 10 courses. SQL Basics has 12 chapters and 77 lessons, with 16 free lessons. Data Analysis with Python and pandas in the browser has 13 chapters and 83 lessons, including 11 free lessons. SQL Performance has 10 chapters and 49 lessons, including EXPLAIN ANALYZE and index work on a 10-million-row database; 6 lessons are free. The ClickHouse course has 8 chapters and 41 lessons, with 5 free. BigQuery has 8 chapters, 27 lessons, and 4 free lessons. Regular Expressions in SQL and JSON and Nested Data each have 6 chapters and 18 lessons, with 3 free lessons each. NoSQL in Practice covers Redis, MongoDB, and Cassandra in 9 chapters and 41 lessons, with 4 free. Data Engineering has 10 chapters and 58 lessons, with 6 free, while Kafka has 10 chapters and 59 lessons, with 7 free. Every lesson combines theory with a task in the browser.

Frequently asked questions

What is the best way to learn SQL online?

Use a structured course for sequence and exercises for repetition. Start with SELECT, filtering, sorting, joins, and aggregation before moving into specialized database or performance topics.

Can I learn SQL free online?

The first chapters of SQL Arena courses are free. The SQL Basics course includes 16 free lessons, and the separate practice area includes 292 free tasks across four SQL dialects.

Do I need to install a database to learn SQL?

Not for these courses. Lessons and exercises run in the browser, with separate environments for supported SQL dialects where relevant.

What is the difference between a SQL course and SQL exercises?

A course provides an ordered curriculum and explains concepts before you use them. An exercise library is better for repetition, mixed practice, and checking whether you can choose the right technique independently.

Start learning SQL in the browser

Begin with the free chapters, write the query after each piece of theory, and move into specialized courses when the fundamentals are comfortable.

Start Learning SQL