SQL
SQL for Beginners — Complete Free Tutorial
Learn SQL from zero with 24 original, hands-on chapters: SELECT, WHERE, sorting, aggregates and GROUP BY, INSERT/UPDATE/DELETE, data types and constraints, primary and foreign keys, inner and outer joins, subqueries, set operations, CTEs, window functions, string and date functions, indexes, views, transactions, schema design and parameterized queries. Every chapter runs against one sample database with exact expected output, common mistakes and a practice checklist.
This complete SQL course takes you from your first SELECT to a designed, indexed, transaction-safe database you can query with confidence. Each chapter is written in plain language and runs on SQLite, the zero-install database you already have on your machine, with every example built on the same small shop database of customers, products, orders and order items so each chapter picks up exactly where the last one stopped. You will learn the language first — selecting, filtering, sorting, grouping and joining — then the parts that separate a written query from a designed system: keys and constraints, subqueries, set operations, common table expressions and window functions. The final chapters cover the engineering side: indexes and query plans, views, transactions and isolation, normalization, and how SQL is actually issued from a PHP or Laravel application through parameterized statements and migrations.
Chapters
- 1. Introduction to SQL Read →
- 2. Setting Up SQLite and Your First Query Read →
- 3. The SELECT Statement Read →
- 4. Filtering Rows with WHERE Read →
- 5. Sorting and Limiting Rows Read →
- 6. Aggregate Functions, GROUP BY and HAVING Read →
- 7. Inserting, Updating and Deleting Data Read →
- 8. Data Types and Constraints Read →
- 9. Keys and Referential Integrity Read →
- 10. The INNER JOIN Read →
- 11. Outer Joins and Join Pitfalls Read →
- 12. Multi-Table Joins and Aliases Read →
- 13. Subqueries Read →
- 14. Set Operations and EXISTS Read →
- 15. Common Table Expressions Read →
- 16. Window Functions Read →
- 17. String Functions and Pattern Matching Read →
- 18. Dates, Numbers and CASE Expressions Read →
- 19. Indexes and Query Performance Read →
- 20. Views and Query Reuse Read →
- 21. Transactions and Concurrency Read →
- 22. Database Design and Normalization Read →
- 23. SQL in Your Application Read →
- 24. SQL Best Practices and Where to Go Next Read →