SQL · T-SQL · SQL SERVER

Learn SQL & T-SQL by doing, on a real SQL Server

From zero to T-SQL programming: how queries are executed, then twenty levels, each with challenges you write and run live on a real SQL Server, a score per level and a cumulative grade.

Learning needs an active account. Register with your name, email and mobile; your request is reviewed and you get an activation email.

  • Real execution

    You write the query in the page and it runs on an isolated SQL Server 2025, with results, messages and errors as in SSMS.

  • Practice after every function

    One or two instantly checked exercises after each function and concept, and a big challenge at the end of every level.

  • A score per level

    A score and grade at the end of every level, a cumulative grade, and you can retake any level to improve it.

What you will learn

  1. 00

    Foundations: SQL, databases and how the engine thinks

    What a relational database is, why SQL describes the result rather than the steps, what T-SQL adds, and how your query travels inside SQL Server from text to result.

    SQL 35 min

  2. 01

    SELECT and FROM: choosing columns and building expressions

    How to pick columns from a table, rename them with aliases, compute new columns from them, and join strings without letting NULL swallow your result.

    SQL 35 min9 exercisesand a big challenge

  3. 02

    WHERE: filtering rows

    How to keep only the rows you want with comparisons, AND/OR/NOT, BETWEEN, IN and LIKE, and why NULL equals nothing, not even itself.

    SQL 40 min10 exercisesand a big challenge

  4. 03

    Sorting and paging: ORDER BY, DISTINCT, TOP and pages

    How to sort results by one or more keys, remove duplicates, take the first N rows or a specific page, and why no order is guaranteed without ORDER BY.

    SQL 40 min9 exercisesand a big challenge

  5. 04

    String functions

    How to measure, slice, search, clean and assemble text with T-SQL functions, and what separates VARCHAR from NVARCHAR when the text is Arabic.

    T-SQL 50 min14 exercisesand a big challenge

  6. 05

    Numbers, data types and conversion

    Arithmetic in SQL Server, the integer-division trap, rounding functions, choosing the right type, and converting safely between types.

    T-SQL 35 min12 exercisesand a big challenge

  7. 06

    Dates and times

    SQL Server date types, extracting date parts, adding to and diffing dates, and filtering a date range the way that lets an index help.

    T-SQL 35 min13 exercisesand a big challenge

  8. 07

    NULL and conditional logic

    What NULL means and how to handle it with ISNULL, COALESCE and NULLIF, then putting decisions inside a query with IIF, CASE and CHOOSE.

    T-SQL 35 min10 exercisesand a big challenge

  9. 08

    Aggregate functions and GROUP BY

    Summarising thousands of rows into numbers: counts, sums, averages and extremes, then splitting data into groups and summarising each one.

    SQL 35 min11 exercisesand a big challenge

  10. 09

    HAVING and filtering groups

    The difference between filtering rows with WHERE and filtering groups with HAVING, then subtotals and grand totals with ROLLUP, CUBE and GROUPING SETS.

    SQL 35 min8 exercisesand a big challenge

  11. 10

    Joining tables (JOIN)

    How to combine rows from several tables into one result: inner, outer, full, cross and self joins, plus the join traps that quietly corrupt your numbers.

    SQL 40 min13 exercisesand a big challenge

  12. 11

    Subqueries

    A query inside a query: a single value, a list with IN, an existence test with EXISTS, a whole table in FROM, and then APPLY for top-N per group.

    SQL 40 min11 exercisesand a big challenge

  13. 12

    Common table expressions (CTE)

    Name the steps of your query with WITH and read it top to bottom, then use recursive CTEs for the org chart and for generating number and date series.

    T-SQL 40 min9 exercisesand a big challenge

  14. 13

    Set operators

    Stack the results of several queries: UNION and UNION ALL to combine, INTERSECT for what they share, EXCEPT for the difference, with their rules and traps.

    SQL 30 min7 exercisesand a big challenge

  15. 14

    Window functions: ranking

    OVER computes across a set of rows without collapsing them: ROW_NUMBER, RANK, DENSE_RANK and NTILE, plus the top-N-per-group and de-duplication patterns.

    SQL 40 min11 exercisesand a big challenge

  16. 15

    Analytic window functions

    Aggregates next to every row: percent of total, running totals, moving averages and month-over-month change.

    SQL 40 min11 exercisesand a big challenge

  17. 16

    Changing data: INSERT, UPDATE and DELETE

    Add, change and remove rows safely, plus OUTPUT, MERGE and SELECT INTO.

    SQL 40 min11 exercisesand a big challenge

  18. 17

    Building tables: CREATE, ALTER and DROP

    Design a table with the right data types and constraints that protect the data, change it later, and use views and temporary tables.

    SQL 40 min9 exercisesand a big challenge

  19. 18

    Programming with T-SQL

    Variables, conditions and loops, then stored procedures and functions that turn a query into a reusable tool.

    T-SQL 45 min11 exercisesand a big challenge

  20. 19

    Transactions and error handling

    How to make several changes succeed together or fail together, and how to catch an error and act on it instead of leaving the data half-changed.

    T-SQL 45 min8 exercisesand a big challenge