A Six-Part Beginner Course on What a Database Is

This is a written course outline you can follow on your own, at your own speed. There is nothing to buy, no enrolment and no certificate. Each part has one goal, a short reading and a small task. Plan about one evening per part.

Before you start

Install a tool that lets you type SQL and see results. SQLite with a simple browser-style app (such as DB Browser for SQLite) is a gentle choice, because the whole database is one file you can delete and recreate. Everything in this course works there.

The six parts

PartGoalTask
1. Why databases existExplain what a database does that a file or spreadsheet does notWrite three sentences in your own words
2. Tables, rows and columnsDescribe data as tablesSketch a table for your music or book collection on paper
3. Your first SQLCreate a table, add rows and read them backRun CREATE TABLE, INSERT and SELECT
4. KeysGive every row an identity and link tablesAdd an id primary key and a second table that points to it
5. How apps connectUnderstand drivers and connection stringsRead a connection string and name every part
6. Staying safeAvoid SQL injection and protect dataRewrite an unsafe query with placeholders

Readings for each part

  1. Our follow-up questions on what a database is.
  2. Our practice unit on tables, rows and columns.
  3. The "getting started" section of the SQLite documentation, or our beginner SELECT modules in SELECT queries in five short modules.
  4. Our picture guide to keys linking two tables.
  5. Our walkthrough of a connection string, piece by piece, and how an app talks to a database, in pictures.
  6. Our hands-on SQL injection exercise.

A small example to carry through the course

Use one example the whole way, so each part builds on the last. A good one is a tiny library:

CREATE TABLE books (
  id     INTEGER PRIMARY KEY,
  title  TEXT NOT NULL,
  author TEXT
);
INSERT INTO books (title, author) VALUES ('Gardens', 'Ada');
SELECT * FROM books;

In part 4 you will move author into its own table. In part 6 you will query it safely from a short program.

Tips for learning on your own

Type, do not paste. Typing SQL yourself makes the words stick much faster.

Break things on purpose. Leave out a comma, insert a row without a title, use a wrong table name. Reading error messages is a skill, and practice files are the place to learn it.

Keep a notes file. Write down each new word (row, column, primary key, query) with your own one-line definition.

Go slowly. One concept per evening is plenty. If a part feels hard, repeat it before moving on.

When you finish

You will be able to explain what a database is, create and query small tables, and connect to one from code safely. The natural next step is the course outline on primary keys, then joins.

A free learning page for beginners. Practise on a test database, never on real customer data, and check the official documentation for your database version.

This page is a free outline. No downloadable files, paid content, courses or certificates are offered on this site.