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
- 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.
- 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.
- 02
WHERE: filtering rows
How to keep only the rows you want with comparisons,
AND/OR/NOT,BETWEEN,INandLIKE, and why NULL equals nothing, not even itself. - 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. - 04
String functions
How to measure, slice, search, clean and assemble text with T-SQL functions, and what separates
VARCHARfromNVARCHARwhen the text is Arabic. - 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 15
Analytic window functions
Aggregates next to every row: percent of total, running totals, moving averages and month-over-month change.
- 16
Changing data: INSERT, UPDATE and DELETE
Add, change and remove rows safely, plus OUTPUT, MERGE and SELECT INTO.
- 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.
- 18
Programming with T-SQL
Variables, conditions and loops, then stored procedures and functions that turn a query into a reusable tool.
- 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.