Learn SQL Step by Step
27 structured tutorials from fundamentals to advanced techniques. Follow the path to SQL mastery.
SQL Fundamentals
Learn the basics of SQL including SELECT statements, filtering with WHERE, and sorting results. Perf...
Advanced Sorting and Filtering
Learn to combine multiple conditions, use pattern matching, work with ranges, and handle NULL values...
SQL Aggregation Functions
Master data aggregation with SQL aggregate functions. Learn to count, sum, average, and group data f...
Handling NULL Values
Master NULL handling in SQL with IS NULL, COALESCE, and NULLIF functions.
Conditional Logic with CASE
Learn to use CASE statements for conditional logic in SQL queries.
Basic Data Manipulation (DML)
Master INSERT, UPDATE, and DELETE statements to modify database data.
SQL Arithmetic Operators
Learn to perform calculations in SQL using arithmetic operators: +, -, *, /, and %. Perfect for anal...
SQL Math Functions
Explore SQL math functions including ROUND, ABS, and MOD for precise calculations, data cleaning, an...
SQL DISTINCT
Master the DISTINCT keyword to eliminate duplicates and count unique values in SQL queries.
Integer Division & Decimals
Learn why SQL division truncates decimals and how to fix it using CAST and type conversion for accur...
SQL Inner Joins
Master INNER JOIN to combine related data from multiple tables.
SQL Outer Joins
Learn LEFT JOIN and RIGHT JOIN to preserve data when relationships don't exist.
SQL Self Joins
Learn to join a table to itself for comparisons and hierarchical queries.
Combining Datasets with UNION
Master UNION and UNION ALL to combine result sets from multiple queries.
Subqueries and Derived Tables
Learn to use subqueries in WHERE, FROM, and SELECT clauses for complex analysis.
Working with Data Types & CASTing
Learn SQL data types and CAST function for type conversion.
Date & Time Functions
Learn essential date and time functions for working with temporal data: date arithmetic, extraction,...
SQL String Functions
Learn essential string functions for cleaning, formatting, and analyzing text data in SQL.
Common Table Expressions (CTEs)
Master CTEs for readable, maintainable complex queries using WITH clause.
SQL Window Functions
Learn ROW_NUMBER, RANK, LAG, LEAD, and aggregate window functions.
Recursive Queries
Learn recursive CTEs for hierarchical data and complex graph traversal.
LEAD & LAG Window Functions
Master LEAD and LAG window functions to analyze trends, calculate period-over-period changes, and pe...
SQL Pivoting & Cross-Tabulation
Master SQL pivoting techniques to create pivot tables and transform long data into wide format for r...
SQL Execution Order
Master SQL query execution order to write better queries, debug errors, and understand query optimiz...
Advanced Aggregations
Master GROUPING SETS, ROLLUP, and CUBE for multi-dimensional analysis.
DDL & Constraints
Master database schema design with CREATE TABLE, constraints, and ALTER statements.
Transactions & Concurrency
Master database transactions and ACID properties for data integrity.
Ready to Practice?
Jump into our interactive SQL editor with real datasets and start building queries.
Try SQLSandboxes Editor