Laroo-Pece Division, Gulu City, Northern Uganda
Uganda time
Data and databases - Intermediate

Databases and SQL for Beginners

Understand how databases store information and use SQL to ask questions, summarise results, join tables and change data safely, finishing with a small library project.

About this course

Almost every app, website, school record system, mobile money service and shop till stores its information in a database. SQL (Structured Query Language) is the language used to ask a database questions such as "which customers have not ordered this month?" or "what were our total sales per product?". It has been in use for decades and is still one of the most useful skills in any data, office or software job.

This course teaches you to think in tables, design a small database on paper, and then write real SQL queries step by step. You will read data, summarise it, combine several tables with joins, and add, change and delete records carefully. Every example uses small sample tables that you can type into a free practice tool and check against the results printed in the lesson.

You can practise at no cost, either in a browser-based SQL playground (a web page where you type SQL and see results, with nothing to install) or with SQLite and a free visual tool such as DB Browser for SQLite. The SQL in this course works in both SQLite and MySQL; where they differ, the lesson tells you.

What you will learn

  • Explain what tables, rows, columns, primary keys and foreign keys are.
  • Design a small database on paper and split the information into sensible tables.
  • Read data with SELECT, WHERE, ORDER BY, LIMIT, DISTINCT, LIKE, IN and BETWEEN.
  • Handle missing values correctly with NULL.
  • Summarise data with COUNT, SUM, AVG, MIN, MAX, GROUP BY, HAVING and CASE.
  • Combine tables with INNER JOIN and LEFT JOIN and answer questions with subqueries.
  • Create tables, insert, update and delete data safely, and understand constraints and indexes.
  • Protect data with backups and recognise the danger of SQL injection.

Course content

5 modules · 19 lessons · 5 h 2 min · 6 quizzes

Module 1: What a database is4 lessons

Learn how data is organised in tables, why databases beat spreadsheets for shared records, how keys connect tables, and set up a place to practise.

  1. Tables, rows and columns 12 min
  2. Spreadsheets versus databases, and relational thinking 14 min
  3. Primary keys, foreign keys and designing on paper 16 min
  4. Setting up a place to practise 15 min
  5. Quiz: 7 questions
Module 2: Reading data4 lessons

Ask questions of one table with SELECT, filter with WHERE, sort and limit results, and handle missing values with NULL.

  1. SELECT, columns and aliases 14 min
  2. Filtering rows with WHERE 18 min
  3. Sorting, limiting and removing duplicates 14 min
  4. NULL: handling missing values 14 min
  5. Quiz: 8 questions
Module 3: Summarising data3 lessons

Turn many rows into answers with aggregate functions, group rows with GROUP BY, filter groups with HAVING and label values with CASE.

  1. Aggregate functions: COUNT, SUM, AVG, MIN and MAX 14 min
  2. GROUP BY and HAVING 18 min
  3. CASE: labelling and conditional totals 16 min
  4. Quiz: 7 questions
Module 4: Working with several tables4 lessons

Link tables with keys, combine them with INNER JOIN and LEFT JOIN, handle many-to-many relationships and answer questions with subqueries.

  1. Keys and relationships in practice: the shop database 16 min
  2. INNER JOIN: combining tables 18 min
  3. LEFT JOIN and many-to-many questions 16 min
  4. Subqueries 15 min
  5. Quiz: 7 questions
Module 5: Changing data and good habits4 lessons

Create tables with the right data types and constraints, insert, update and delete safely, understand indexes, backups and SQL injection, and finish with a library project.

  1. CREATE TABLE, data types and constraints 16 min
  2. INSERT, UPDATE and DELETE (and why WHERE matters) 16 min
  3. Indexes, backups and SQL injection awareness 15 min
  4. Mini project: a library database 25 min
  5. Quiz: 8 questions
Final exam

29 questions. Pass with 70% or more to earn your certificate.

What you need

  • A computer or laptop with a web browser
  • Basic computer skills and comfort with spreadsheets (see Microsoft Excel: Spreadsheets from Zero)
  • No programming experience needed

Further reading

To install on iPhone or iPad: tap the Share button in Safari, then choose "Add to Home Screen".