Code24Lab
Databases & SQL Beginner

SQL Foundations: SELECT, Filters, Sorting & Aggregates

Read and reason through real SQL on a fictional bookshop database: SELECT, WHERE, AND/OR, IN, BETWEEN, LIKE, NULL, ORDER BY, LIMIT, aggregates, GROUP BY, HAVING and INSERT/UPDATE/DELETE, with every answer checked as you go.

21 lessons 21 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

SQL Foundations teaches you to read and predict real SQL queries. You work with a small fictional bookshop database, a books table and an orders table, and in every lesson you work out exactly what a query returns: which rows a WHERE keeps, how AND, OR, IN, BETWEEN and LIKE behave, what NULL does to comparisons and averages, how ORDER BY, LIMIT and OFFSET build top lists and pages, and how COUNT, SUM, AVG, GROUP BY and HAVING turn rows into reports. You also see what INSERT, UPDATE and DELETE change, debug broken queries and finish with a complete report query. Every answer is checked instantly, and the first lesson is free.

Lessons

  1. SELECT: Choose Columns and Calculate New OnesLabFree
  2. WHERE: Keep Only the Rows You NeedLab Locked
  3. AND, OR, NOT and Why Parentheses MatterLab Locked
  4. IN and BETWEEN: Lists and RangesLab Locked
  5. LIKE Patterns: Searching Text with % and _Lab Locked
  6. ORDER BY: Sort Results Your WayLab Locked
  7. LIMIT, TOP and OFFSET: Top-N Lists and PagesLab Locked
  8. DISTINCT: Remove Duplicate RowsLab Locked
  9. NULL: Missing Values, IS NULL and IS NOT NULLLab Locked
  10. NULL in Calculations: COUNT(*) vs COUNT(column), COALESCELab Locked
  11. Aggregate Functions: COUNT, SUM, AVG, MIN, MAXLab Locked
  12. Aggregates with WHERE: Filtered TotalsLab Locked
  13. GROUP BY: One Result Row per GroupLab Locked
  14. GROUP BY Several Columns: Groups That ExistLab Locked
  15. HAVING: Filter Groups After AggregatingLab Locked
  16. The Logical Order of a Query: FROM to LIMITLab Locked
  17. INSERT: Adding Rows to a TableLab Locked
  18. UPDATE: Changing Rows (and Why WHERE Matters)Lab Locked
  19. DELETE: Removing Rows SafelyLab Locked
  20. Debug Lab: Spot and Fix Broken QueriesLab Locked
  21. Final Project: The Monthly Genre ReportLab Locked