Start of Term: Setting Up a Practice Database for Your Course

The first weeks of a course or bootcamp are the best time to set up a calm practice space for SQL. A little preparation saves you from fighting installation problems the night before an assignment is due.

Week one: pick your practice database

If your course names a database, use that. If not, SQLite is the easiest start: no server, no passwords, one file. You can open it with the sqlite3 command-line tool or a free graphical browser such as DB Browser for SQLite.

If your course uses PostgreSQL or MySQL, install it early and make sure you can log in. Write down the user name you created and keep the password somewhere safe, such as a password manager, not on a sticky note.

Week one: make a project folder

Create one folder for the course, with this inside:

sql-course/
  practice.db          (or connection notes for a server database)
  schema.sql           (your CREATE TABLE statements)
  seed.sql             (INSERT statements with sample data)
  exercises/
    week01.sql
    week02.sql

Keeping statements in files means you can rebuild your database at any time:

sqlite3 practice.db < schema.sql
sqlite3 practice.db < seed.sql

If an experiment goes wrong, delete practice.db and rebuild. That freedom makes learning less stressful.

Week two: build a small sample dataset

Pick something you care about: books you have read, a sports team, recipes. Make two or three tables that link together, for example authors and books. Twenty or thirty rows is enough to practise filtering, sorting and joining.

A weekly rhythm for the term

WeekPractiseOur page to read alongside
1-2Creating tables, inserting rowsTables, rows and columns
3-4SELECT, WHERE, ORDER BYFiltering and sorting
5-6Primary and foreign keysKeys linking two tables
7-8JOINsINNER and LEFT JOIN step by step
9-10Connecting from codeConnecting Python to SQLite
11-12Safe queriesPlaceholders and SQL injection

Common start-of-term headaches

Ask for help early

Classmates and instructors would much rather help in week one than in week ten. When you ask, include the exact error message and what you typed. That habit will serve you well for the rest of your career.

A small promise to yourself

Fifteen minutes of practice several times a week beats a long session once a month. Set a reminder and keep your practice database close at hand.

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.