Learn SQL From Zero to Expert
22+ free SQL tutorials covering Core SQL, Advanced techniques, Performance optimization, and database-specific guides for MySQL, PostgreSQL, and SQL Server.
Core SQL
12 tutorials
SQL SELECT Statement
beginnerThe SQL SELECT statement retrieves rows and columns from one or more database tables, optionally filtered, sorted, and limited.
SQL WHERE Clause
beginnerThe SQL WHERE clause filters rows returned by a query, including only rows that satisfy a specified condition.
SQL GROUP BY Clause
intermediateThe SQL GROUP BY clause groups rows with the same values in specified columns into summary rows, typically used with aggregate functions like COUNT, SUM, AVG, MIN, and MAX.
SQL JOINs Explained
intermediateSQL JOINs combine rows from two or more tables based on a related column, enabling queries that span multiple tables in a relational database.
SQL Subqueries
intermediateA SQL subquery is a query nested inside another SQL statement, used to compute values, filter rows, or define temporary datasets for the outer query.
SQL HAVING Clause
intermediateThe SQL HAVING clause filters groups produced by GROUP BY, allowing conditions on aggregate functions like COUNT, SUM, and AVG that cannot be used in WHERE.
SQL Aggregate Functions
beginnerSQL aggregate functions perform calculations on a set of rows and return a single summary value, including COUNT, SUM, AVG, MIN, and MAX.
SQL NULL Handling
beginnerNULL in SQL represents the absence of a value or unknown data, and it behaves differently from zero or empty string — NULL is not equal to anything, including itself.
SQL CASE WHEN Expressions
beginnerThe SQL CASE WHEN expression evaluates a list of conditions and returns a value for the first true condition, functioning as SQL's if-then-else logic.
SQL JOINs in PostgreSQL
intermediatePostgreSQL supports all standard SQL JOIN types plus LATERAL joins, which allow subqueries in the FROM clause to reference columns from preceding table references.
PostgreSQL SpecificSQL JOINs in MySQL
intermediateMySQL implements all standard SQL JOIN types with its own optimizer that uses hash joins, block nested loop joins, and index-based nested loops for performance.
MySQL SpecificGROUP BY in MySQL
intermediateMySQL GROUP BY aggregates rows with identical values and, in strict mode (ONLY_FULL_GROUP_BY), requires all non-aggregated SELECT columns to be in the GROUP BY clause.
MySQL SpecificAdvanced SQL
4 tutorials
SQL Window Functions
advancedSQL window functions perform calculations across a set of table rows related to the current row without collapsing rows into groups, unlike GROUP BY.
SQL CTEs (Common Table Expressions)
intermediateA Common Table Expression (CTE) is a named temporary result set defined with the WITH keyword that exists only for the duration of a single SQL statement.
Window Functions in PostgreSQL
advancedPostgreSQL window functions compute values across a 'window' of rows related to the current row using OVER(), enabling analytics without collapsing rows.
PostgreSQL SpecificCTEs in PostgreSQL
intermediatePostgreSQL CTEs support recursive queries, writeable CTE operations (INSERT/UPDATE/DELETE), and explicit MATERIALIZED/NOT MATERIALIZED hints for performance control.
PostgreSQL SpecificPerformance
4 tutorials
SQL Database Indexing
intermediateA database index is a data structure that improves the speed of data retrieval operations by creating a sorted reference to one or more columns of a table.
SQL Query Optimization
advancedSQL query optimization is the process of rewriting queries and adjusting database settings to minimize execution time and resource consumption.
Indexing in PostgreSQL
intermediatePostgreSQL supports multiple index types including B-tree, Hash, GiST, GIN, BRIN, and SP-GiST, each optimized for different data types and query patterns.
PostgreSQL SpecificIndexing in MySQL
intermediateMySQL uses B-tree indexes by default (InnoDB), with additional support for FULLTEXT, SPATIAL, and Hash indexes (Memory engine only).
MySQL SpecificDatabase Design
1 tutorials
Database Engineering
1 tutorials
Ready to Practice?
Put your SQL knowledge to work in our live interactive playground.