Learn SQL by writing SQL

52 free lessons on SQL and SQL Server, from your first query to triggers. Many examples run right here in your browser, with nothing to install.

Try it: how much has each customer of the course shop spent?

PostgreSQL in your browser · Ctrl+Enter to run · changes are rolled back afterwards

The course, step by step

Seven parts, in order. Each one builds on the previous, but you can jump into whichever you need.

  1. Introduction to SQL Server

    What SQL is, how a relational database is organised and how to install SQL Server to follow the course.

    7 lessons Start with: Introduction to SQL and SQL Server

  2. Creation and management of SQL databases

    Build the course shop database and learn to insert, update and delete rows.

    12 lessons Start with: CREATE DATABASE statement in SQL

  3. SQL query execution

    SELECT, filters, sorting, grouping, JOIN and subqueries. Every lesson has runnable examples.

    10 lessons Start with: SELECT statement in SQL

  4. Advanced SQL queries

    CTEs, EXISTS, window functions such as ROW_NUMBER and LAG, running totals and PIVOT: the SQL that comes up in interviews.

    7 lessons Start with: CTE in SQL: the WITH clause

  5. Language elements

    Variables, operators, IF, WHILE, transactions and error handling in Transact-SQL.

    8 lessons Start with: Variables in Transact SQL

  6. SQL functions

    SQL Server built-in functions and how to write your own.

    5 lessons Start with: Built-in functions in SQL

  7. Advanced SQL elements

    Views, stored procedures and triggers: logic that lives inside the database.

    3 lessons Start with: Views in SQL

Frequently Asked Questions

In SQLearning we will learn in a didactic way with replicable examples all the most important concepts of Transact-SQL management, from the simplest to the most advanced ones

What does SQLearning offer?

In SQLearning we will learn in a didactic way,with replicable examples, the most important concepts of handling Transact-SQL, from the simplest one to the most advanced.

Why Transact-SQL and not SQL?

With Transact-SQL we will learn the entire SQL standard, plus the characteristics of said language (Stored Procedures, Triggers,...).

Why SQL Server as an alternative to ORACLE?

The answer largely depends on the needs of each user. However, from SQLearning we facilitate the learning of Transact-SQL since it is used more in small and medium-sized companies while ORACLE is more frequently used in large organizations.

Why is so important to learn SQL?

The use and handling of databases is present in innumerable applications and technologies, which makes SQL one of the most demanded programming languages today.

Who should learn SQL?

Any person who wants to work with data management (analysts, data scientists...), backend-fullstack developers, mobile application developers... In addition, SQL should be learned by anyone interested in the use and management of databases.

Can SQL be used in other programming languages?

Yes, SQL is often used externally from other programming languages. C, Java or Python are some examples.