SQL is the language of relational databases — used in banking, healthcare, retail, and government across South Africa.
Start with Lesson 1Each lesson includes a full explanation, code examples, a practice task, common mistakes, and a mini quiz.
SQL is the language of relational databases — used in every sector of South African business....
Lesson 1Tables, rows, columns, relationships, and ACID....
Lesson 2Tables store data in typed columns and rows....
Lesson 3A primary key uniquely identifies every row....
Lesson 4Foreign keys link tables and enforce referential integrity....
Lesson 5SELECT retrieves data — the most important SQL statement....
Lesson 6WHERE filters rows returned by a query....
Lesson 7ORDER BY controls sort order — without it, row order is undefined....
Lesson 8INSERT adds new rows to a table....
Lesson 9UPDATE changes existing data. Always use WHERE....
Lesson 10DELETE removes rows. Extremely dangerous without WHERE....
Lesson 11CREATE TABLE defines a table's full structure....
Lesson 12ALTER TABLE modifies an existing table's structure....
Lesson 13DROP TABLE permanently removes a table and all its data....
Lesson 14COUNT, SUM, AVG, MIN, MAX — summarise sets of rows....
Lesson 15GROUP BY groups rows to apply aggregates per group....
Lesson 16HAVING filters groups after GROUP BY....
Lesson 17Joins combine rows from multiple tables using related columns....
Lesson 18INNER JOIN — the most common join, matched rows only....
Lesson 19LEFT JOIN returns all rows from the left table — NULL from right where no match....
Lesson 20RIGHT JOIN returns all rows from the right table — mirror of LEFT JOIN....
Lesson 21FULL OUTER JOIN returns all rows from both tables with NULL where no match....
Lesson 22A subquery is a query nested inside another....
Lesson 23A view is a saved query that acts like a table....
Lesson 24Indexes speed up SELECT at the cost of write overhead....
Lesson 25Named, reusable SQL blocks — encapsulate business logic....
Lesson 26Entities, attributes, relationships — design before you code....
Lesson 27Organise a database to reduce redundancy — 1NF, 2NF, 3NF....
Lesson 28