← All series & guides

Series

SQL series

14 parts

Step-by-step SQL — from playground setup through joins, subqueries, and optimization.

Start with part 1 →

  1. · SQL for Beginners: What is SQL and Why You Should Learn It SQL is how you ask a database for answers instead of scrolling forever. This intro explains tables, the toy customers and orders schema, why SQL still matters at work, and the roadmap for the full SQL series.
  2. 1 SQL Tutorial 1: Setting Up Your SQL Playground Set up a low-drama SQL playground with SQLite first, then compare common engines for later work. Create the toy customers and orders tables in your head and on disk, and run your first SELECT so the series can move from theory to practice.
  3. 2 SQL Tutorial 2: Master the Core Commands (SELECT, INSERT, UPDATE, DELETE) Master the four core SQL commands: SELECT to read, INSERT to add, UPDATE to change, and DELETE to remove. Learn the safety habits that keep practice useful and production data unharmed, especially never writing UPDATE or DELETE without a WHERE.
  4. 3 SQL Tutorial 3: Retrieving Data with SELECT Learn to retrieve exactly the columns you need with SELECT, rename them with aliases, remove duplicate rows with DISTINCT, and cap result size with LIMIT. Stop shipping SELECT star dumps when a clear, small result would answer the question.
  5. 4 SQL Tutorial 4: Filtering and Sorting Data in SQL Filter rows with WHERE, combine conditions with AND and OR, and use IN, BETWEEN, and careful LIKE patterns. Sort with ORDER BY and learn NULL basics so your SQL answers match the business question, not accidental leftovers.
  6. 5 SQL Tutorial 5: Aggregate Functions and Grouping Data Turn rows into summaries with COUNT, SUM, AVG, MIN, and MAX. Group with GROUP BY, and learn when HAVING filters groups while WHERE filters rows, so your totals match the question leadership actually asked.
  7. 6 SQL Tutorial 6: Joins in SQL Connect customers to orders with INNER and LEFT joins, using keys on purpose. Learn how join grain can explode row counts, when not to join, and how to check totals so multi-table SQL stays trustworthy.
  8. 7 SQL Tutorial 7: Subqueries in SQL Subqueries nest one query inside another so you can filter and shape results with answers from other answers. Learn scalar, IN, EXISTS, and derived tables on the customers and orders toy schema, plus when a CTE will read cleaner later.
  9. 8 SQL Tutorial 8: Modifying Data with SQL Change data safely with INSERT, UPDATE, and DELETE on the customers and orders toy schema. Practice row adds, targeted edits, and careful deletes, plus a light take on transactions and why backups matter before any mass update.
  10. 9 SQL Tutorial 9: Views and Indexes Reuse logic with views and speed lookups with indexes on everyday customer and order queries. Learn what each database object is for, how teams share meaning safely, and why neither tool is a free performance spell by itself.
  11. 10 SQL Tutorial 10: Advanced SQL Techniques Level up multi-step SQL with CTEs for readable named steps, window functions like ROW_NUMBER and running sums on detail rows, and a small conceptual recursive example you can grow into real hierarchy work at your job.
  12. 11 SQL Tutorial 11: Stored Procedures, Triggers, and User-Defined Functions Understand stored procedures, triggers, and user-defined functions as database objects you may inherit at work. Learn when analysts should care, when SQL scripts or dbt-style models fit better, and why portability still matters across engines.
  13. 12 SQL Tutorial 12: Best Practices and Optimization Write cleaner and faster SQL with an EXPLAIN mindset, tight select lists, sargable filters, and index awareness on real customer and order patterns. Learn practical optimization habits without premature complexity or cargo-cult tuning tricks at work.
  14. 13 SQL Tutorial 13: Strategies for Maintenance and Optimization Keep databases healthy over time with backups you can restore, slow query awareness, stats and vacuum concepts, access grants, and on-call hygiene. Close the SQL series with a full path recap and next learning links.