All topics

Databases and SQL

Learners design small databases and use SQL to read, change, and summarize records safely.

Outline

Who it is for: Learners who keep records in spreadsheets and want a safer, more reliable way to store them.

Clinics, schools, and shops often keep records in many loose spreadsheets that are hard to check. A proper database keeps one copy of each fact and answers questions quickly. At the end, the learner can design a small database, write SQL to find and total records, and set up a backup.

We use SQLite with DB Browser for SQLite. Both are free and work offline. Uganda’s Data Protection and Privacy Act (2019) applies to records about people, so the last lesson covers who may see what.

AI tools write SQL quickly but can return wrong totals or delete the wrong rows. Learners check every query on a small table where they already know the answer. AI policy: Pioneers and adults may use AI to suggest a query after the checkpoint, and must test it on known data first. The checkpoint is done without AI.

Planned lessons

  1. Tables, rows, and columns
  2. Keys: primary and foreign
  3. SELECT: reading data with filters
  4. Sorting, limiting, and counting
  5. Grouping and totals with GROUP BY
  6. Joining two tables
  7. INSERT, UPDATE, and DELETE safely
  8. Designing a small database for a clinic or shop: one fact in one place
  9. Keeping SQL safe from injection: queries with parameters
  10. Checking a query: does it return what you expect?
  11. Backups, access rights, and data protection

Teach it as

One sessionCreate one table in SQLite, add a few rows, and select rows with a filter, in one 2 hour class.
One dayMorning: tables, keys, SELECT with filters, and sorting. Afternoon: counting and totals, joining two tables, and changing data safely.
One weekDay 1: tables, rows, columns, and keys. Day 2: SELECT, filters, sorting, and counting. Day 3: GROUP BY and joins. Day 4: changing data safely, design, and SQL injection. Day 5 (Build and Show): checkpoint without AI, then each learner shows a small clinic or shop database, its queries, and its backup.

Know this first

Standards this follows

Videos to download

No videos listed yet.