SQL Tutorials – Learn SQL from Basics to Advanced
SQL is the standard language for working with relational databases. These guides cover querying, managing databases and tables, modifying data, and keeping your database secure and performant. Whether you're writing your first SELECT or optimizing slow queries, you'll find a practical guide for it here.
Getting Started
The essentials before anything else: how to run queries, how to write them well, and how to document your SQL code with comments.
Learn SQL on Mimo
- How to Run an SQL Query
- How to Write SELECT Queries in SQL
- How to Comment in SQL
- How to Optimize SQL Queries
- How to Prevent SQL Injection
Databases
Everything related to creating and managing the database itself, including backups before you make changes you might regret.
Tables
Tables are where your data lives. These guides cover the full lifecycle: creating, copying, renaming, clearing, and dropping them.
- How to Create a Table in SQL
- How to Delete a Table in SQL
- How to Rename a Table in SQL
- How to Truncate a Table in SQL
- How to Copy a Table in SQL
- How to Create a Temporary Table in SQL
Columns & Data
Adding and changing what's inside your tables — columns, rows, and the data stored in them.
- How to Add a Column in SQL
- How to Delete a Column in SQL
- How to Rename a Column in SQL
- How to Modify a Column in SQL
- How to Insert Data in SQL
- How to Update Data in SQL
- How to Delete Data in SQL
Querying Data
The core SELECT toolkit. These guides cover filtering, sorting, deduplicating, and limiting results — everything you need to retrieve exactly the data you're looking for.
- How to Use SELECT in SQL
- How to Use WHERE in SQL
- How to Use DISTINCT in SQL
- How to Use LIKE in SQL
- How to Use IN in SQL
- How to Use BETWEEN in SQL
- How to Handle NULL in SQL
- How to Use ORDER BY in SQL
- How to Use LIMIT in SQL
Joins
Joins combine data from multiple tables. These guides cover each join type and explain when to use one over another.
- How to Join Tables in SQL
- How to Use INNER JOIN in SQL
- How to Use LEFT JOIN in SQL
- How to Use RIGHT JOIN in SQL
- How to Use FULL JOIN in SQL
Aggregation & Grouping
Summarizing data across rows — counts, sums, averages, and grouping results with filtering on the aggregated output.
- How to Use COUNT in SQL
- How to Use SUM in SQL
- How to Use AVG in SQL
- How to Use MAX and MIN in SQL
- How to Use GROUP BY in SQL
- How to Use HAVING in SQL
String & Date Functions
Built-in functions for transforming text and working with date values inside your queries.
- How to Concatenate in SQL
- How to Use SUBSTRING in SQL
- How to Use REPLACE in SQL
- How to Use UPPER and LOWER in SQL
- How to Escape Single Quote in SQL
- How to Round in SQL
- How to Format Date in SQL
- How to Get Current Date in SQL
Advanced Queries
Beyond basic SELECT: combining result sets, conditional logic, nested queries, deduplication, and pivoting data.
- How to Remove Duplicates in SQL
- How to Use UNION in SQL
- How to Use EXISTS in SQL
- How to Use CASE in SQL
- How to Write Subqueries in SQL
- How to Pivot in SQL
Schema & Constraints
The structural rules that keep your data consistent and your queries fast — keys, indexes, auto-increment, and data types.
- How to Set a Primary Key in SQL
- How to Add a Foreign Key in SQL
- How to Use Auto Increment in SQL
- How to Change Data Type in SQL
- How to Create an Index in SQL
Programmability
Reusable database objects — views, stored procedures, functions, triggers, and transactions — that move logic closer to the data.
- How to Create a View in SQL
- How to Create a Stored Procedure in SQL
- How to Call a Stored Procedure in SQL
- How to Create a Function in SQL
- How to Create a Trigger in SQL
- How to Use Transactions in SQL
Import & Export
Moving data in and out of your database — useful for migrations, backups, and working with external data sources.
Join 35M+ people learning for free on Mimo
4.8 out of 5 across 1M+ reviews
Check us out on Apple AppStore, Google Play Store, and Trustpilot