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
| Week | Practise | Our page to read alongside |
|---|---|---|
| 1-2 | Creating tables, inserting rows | Tables, rows and columns |
| 3-4 | SELECT, WHERE, ORDER BY | Filtering and sorting |
| 5-6 | Primary and foreign keys | Keys linking two tables |
| 7-8 | JOINs | INNER and LEFT JOIN step by step |
| 9-10 | Connecting from code | Connecting Python to SQLite |
| 11-12 | Safe queries | Placeholders and SQL injection |
Common start-of-term headaches
- "Command not found." The tool is installed but not on your system path. Search for your operating system plus the tool name and "add to PATH".
- Forgot the password for a local server database. Each database documents how to reset it; for coursework, reinstalling may be quicker.
- Work lost after closing the tool. You ran statements interactively and never saved them. Keep them in your
.sqlfiles. - Version mismatch with the course. Check the version the course expects; small differences can make examples fail.
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.