SQL from the ground up
Start with databases and tables, then write real queries in the practice lab.
What Is a Database? A Beginner-Friendly Explanation
Almost every app, website, and business system uses a database. When you create an account, your details are stored somewhere.When you buy something online, your order is…
Open lesson →How Is Data Stored in a Database?
Before you learn SQL, you need to understand how data is stored in a database. Many beginners think a database is one big file where everything is…
Open lesson →What Is SQL and What Is It Used For?
SQL is the language people use to communicate with relational databases. This simple guide explains what it does and why it is worth learning.
Open lesson →SQL Practice Lab: SELECT, WHERE, GROUP BY and JOIN
Turn the SQL basics into something you can run. In this practice lab, you will select columns, filter rows, sort results, calculate totals and connect two tables.…
Open lesson →SQL SELECT for Beginners: Choose Columns and Name Your Results
Learn SQL SELECT with a small shop database. Choose columns, use aliases, calculate values and check your results with beginner exercises.
Open lesson →SQL WHERE Explained: Filter Rows with AND, OR and IN
Learn SQL WHERE through clear examples. Combine conditions with AND and OR, use IN and BETWEEN, and avoid common filtering mistakes.
Open lesson →SQL ORDER BY and LIMIT: Sort Results and Find the Top Rows
Sort SQL results with ORDER BY, choose ascending or descending order, handle ties and use LIMIT with a practical top-orders exercise.
Open lesson →SQL DISTINCT and NULL: Understand Unique and Missing Values
Understand SQL DISTINCT and NULL with small examples. Remove duplicate result combinations and handle missing values without misleading counts.
Open lesson →SQL Aggregate Functions: COUNT, SUM, AVG, MIN and MAX
Learn COUNT, SUM, AVG, MIN and MAX in SQL. Check totals, handle missing values and avoid confusing order counts with customer counts.
Open lesson →SQL GROUP BY and HAVING: Build Useful Summary Reports
Build SQL summary reports with GROUP BY and HAVING. Learn the difference between filtering rows and filtering groups with checked examples.
Open lesson →SQL INNER JOIN for Beginners: Connect Customers and Orders
Connect two SQL tables with INNER JOIN. Understand matching keys, one-to-many relationships, aliases and repeated names in query results.
Open lesson →SQL LEFT JOIN Explained: Keep Customers with No Orders
Learn SQL LEFT JOIN with customers who have no orders. Handle NULL, count matches correctly and avoid accidentally turning it into an inner join.
Open lesson →SQL CASE WHEN: Create Labels and Conditional Totals
Use SQL CASE WHEN to label orders and build conditional totals. Learn condition order, ELSE behaviour and a beginner reporting exercise.
Open lesson →SQL Subqueries and EXISTS: Answer Questions in Two Steps
Learn SQL subqueries and EXISTS with above-average orders and customer matching examples. Practise clear two-step reasoning and checked answers.
Open lesson →SQL Common Table Expressions: Make a Long Query Easier to Read
Use SQL common table expressions to break a report into named steps. Build customer totals, filter the summary and check the result.
Open lesson →SQL UNION and UNION ALL: Combine Lists Without Surprises
Combine SQL result lists using UNION and UNION ALL. Understand duplicate removal, compatible columns and final sorting with a small example.
Open lesson →SQL Text Functions: Clean Labels Without Changing Their Meaning
Use SQLite text functions to inspect and clean labels. Practise TRIM, LOWER, LENGTH and SUBSTR while preserving identifiers and original values.
Open lesson →SQL Dates in SQLite: Filter a Month and Calculate Day Differences
Work with SQLite dates using clear ISO values. Filter a month with an exclusive upper boundary and calculate elapsed days with julianday.
Open lesson →SQL ROW_NUMBER: Number Rows Within Each Customer
Learn ROW_NUMBER with a small order table. Keep detail rows, partition by customer and use a deterministic tie-breaker for top-per-group results.
Open lesson →SQL Running Totals: Add Values Without Losing the Detail
Build a SQL running total with SUM OVER. Specify row order and an explicit window frame, then compare cumulative and per-customer totals.
Open lesson →Find Duplicate Records in SQL Before You Delete Anything
Find SQL duplicates with an explicit business key. Distinguish repeated activity from duplicate records and inspect candidates before changing data.
Open lesson →Practise SQL UPDATE Safely with a Transaction and ROLLBACK
Practise SQL UPDATE in a disposable database. Preview the WHERE condition, inspect affected rows and use ROLLBACK to undo the exercise.
Open lesson →SQL Table Constraints: Protect Keys and Required Values
Learn SQL primary keys, NOT NULL, UNIQUE and CHECK constraints. Create a small practice table and understand what constraints can and cannot validate.
Open lesson →SQL Report Project: Check a Customer Summary from Start to Finish
Build a complete beginner SQL report with joins, totals and validation checks. Define the output grain and reconcile customer results to source orders.
Open lesson →