How to use this guide: Click any part below to open it. Each syntax has a code example you can copy into MySQL, and a visual output table showing exactly what the result looks like. Examples use real-world data like employees, products, orders, and customers.
Foundations
1
SQL Basics
The foundation of everything — reading, writing, updating, and deleting data. JOINs to connect tables. Filtering, sorting, and grouping results.
2
Window Functions, CTEs & Aggregates
Ranking data, comparing rows, temporary named queries, and summarizing data with COUNT, SUM, AVG and more.
Functions Library
3
JSON & String Functions
Work with JSON data stored in columns, and manipulate text — concatenation, searching, replacing, regex, formatting.
4
Date/Time, Numeric & Control Flow
Date calculations, math operations, and conditional logic — IF, CASE, COALESCE for handling different scenarios in queries.
Query Techniques
5
Subqueries, Set Operations & Indexes
Queries within queries, combining result sets with UNION/INTERSECT/EXCEPT, and making queries fast with indexes.
6
Table Management, Constraints & Views
Creating and modifying tables, enforcing data rules with constraints (PRIMARY KEY, FOREIGN KEY, CHECK), and virtual tables with Views.
Advanced & Administration
Complete MySQL Reference (Advanced)
8A
Type Casting, Info Functions, Insert Variations & Full-Text Search
Type conversion with CAST/CONVERT, system info functions (UUID, LAST_INSERT_ID), advanced INSERT patterns (UPSERT, REPLACE INTO), and full-text search with MATCH AGAINST.
8B
Encryption, Binary, Prepared Statements, Cursors & Error Handling
Hashing (MD5, SHA2), encryption (AES), bitwise operations, prepared statements for safe queries, cursors for row-by-row processing, and error handling in procedures.
8C
Flow Control, Events, Partitioning, Locking & Miscellaneous
Procedural loops (WHILE, REPEAT, LOOP), scheduled events, table partitioning for large datasets, row/table locking for concurrency, and essential maintenance commands.
Recommended learning order: Start with Part 1 (Basics) — this is the foundation for everything. Then Part 4 (Date/Time & Control Flow) since you'll use these daily. Then Part 2 (Window Functions & Aggregates) for reporting. Parts 3, 5, 6 can be learned as needed. Part 7 when you're comfortable with basics. Parts 8A-8C are the complete advanced reference — tackle these last when you want to master everything MySQL has to offer.