A comprehensive learning roadmap for SQL — from writing your first SELECT to advanced query optimization, window functions, and database design.
§ SYLLABUS
- 01The Relational Model
Understand how data is organized into tables with rows and columns, and why relational databases use this structure.
- 02SELECT & FROM
Write basic queries to retrieve columns from a single table and understand how SQL processes a query.
- 03Common Data Types
Learn the main SQL data types — integers, text, dates, booleans, decimals — and when to use each one.
- 04NULL Values
Understand what NULL means in SQL, how it behaves in comparisons and expressions, and how to handle it with IS NULL and COALESCE.
- 05SQL Fundamentals Complete
You can write basic SELECT queries and understand how relational databases organize data.
- 01WHERE Clause
Filter rows using comparison operators, BETWEEN, IN, LIKE, and combine conditions with AND, OR, and NOT.
- 02ORDER BY & LIMIT
Sort results by one or more columns and restrict the number of rows returned.
- 03DISTINCT & Aliases
Remove duplicate rows from results and rename columns or tables with aliases for readability.
- 04Filtering & Sorting Complete
You can retrieve exactly the subset of data you need, sorted and de-duplicated.
- 01INNER JOIN
Combine rows from two tables where a matching condition is met, which is the most common type of join.
- 02LEFT & RIGHT JOIN
Retrieve all rows from one table even when there is no match in the other, filling gaps with NULLs.
- 03FULL & CROSS JOIN
Understand FULL OUTER JOIN for preserving unmatched rows from both sides, and CROSS JOIN for generating all combinations.
- 04Self Joins
Join a table to itself to compare rows within the same dataset, such as finding employees and their managers.
- 05Joins Complete
You can combine data from multiple tables using the right join type for each situation.
- 01Aggregate Functions
Use COUNT, SUM, AVG, MIN, and MAX to compute summary statistics across rows.
- 02GROUP BY
Group rows that share a value and apply aggregate functions to each group independently.
- 03HAVING Clause
Filter groups after aggregation, which WHERE cannot do because it runs before grouping.
- 04Aggregation Complete
You can summarize and group data to produce reports and statistics.
- 01Subqueries
Nest a query inside another query to use one result set as input for filtering, comparison, or derived tables.
- 02Common Table Expressions (CTEs)
Use WITH clauses to name temporary result sets, making complex queries readable and reusable within a statement.
- 03UNION, INTERSECT & EXCEPT
Combine result sets from multiple queries vertically — stacking, finding overlap, or computing differences.
- 04Subqueries & CTEs Complete
You can break complex problems into composable query building blocks.
- 01INSERT
Add new rows to a table, including bulk inserts and inserting from the results of a SELECT query.
- 02UPDATE & DELETE
Modify existing rows or remove them, and understand why a WHERE clause is critical for safety.
- 03Transactions
Group multiple statements into an atomic unit with COMMIT and ROLLBACK so partial failures don't corrupt data.
- 04Data Modification Complete
You can safely insert, update, and delete data with transactional guarantees.
- 01CREATE TABLE & ALTER TABLE
Define new tables, add or drop columns, and modify table structure as requirements evolve.
- 02Constraints & Keys
Enforce data integrity with PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK, and DEFAULT constraints.
- 03Normalization
Organize tables to reduce redundancy and prevent update anomalies, understanding 1NF through 3NF.
- 04Views
Create virtual tables from saved queries to simplify access, encapsulate logic, and control what users can see.
- 05Schema Design Complete
You can design normalized database schemas with proper constraints and relationships.
- 01Window Functions
Perform calculations across related rows without collapsing them — ROW_NUMBER, RANK, LAG, LEAD, and running totals.
- 02Recursive CTEs
Traverse hierarchical or graph-like data such as org charts or category trees using self-referencing CTEs.
- 03CASE Expressions & Pivoting
Use conditional logic inside queries to transform rows into columns or categorize data on the fly.
- 04Advanced SQL Complete
You can write sophisticated analytical queries using window functions and recursive patterns.
- 01Indexes
Understand how indexes speed up reads, the trade-off with write performance, and when to create or avoid them.
- 02EXPLAIN & Query Plans
Read execution plans to understand how the database engine processes your query and spot bottlenecks.
- 03Query Optimization Patterns
Rewrite slow queries using techniques like avoiding SELECT *, reducing subquery overhead, and leveraging indexes effectively.
- 04Performance Complete
You can analyze and optimize SQL queries for real-world workloads.