A Reusable Query Notebook Template for Practising SELECT

Learners who keep a simple notebook of their queries improve faster. Each entry records the question, a prediction and what actually happened. This template gives you a consistent format you can reuse in any text file or note-taking app.

The template

ENTRY #<number>      Date: <date>
Database / table: <e.g. SQLite / library.books>

QUESTION
<the question in plain words>

PREDICTION
- Rows I expect: <number or description>
- Tricky parts: <NULLs? duplicates? sorting?>

QUERY
<your SQL>

RESULT
- Rows returned: <number>
- Matched my prediction? <yes / no>

WHAT I LEARNED
<one or two sentences>

Why the prediction step matters

It is tempting to skip straight to the query. Predicting first turns every result into a small experiment. When the result surprises you, you have found something specific to learn, such as how NULL behaves in a filter, rather than just a query that "didn't work".

Example entry

ENTRY #7      Date: (date)
Database / table: SQLite / pets

QUESTION
Which cats are older than 2?

PREDICTION
- Rows I expect: 2 (Mochi and Luna)
- Tricky parts: Luna's age might be missing

QUERY
SELECT name FROM pets WHERE species = 'cat' AND age > 2;

RESULT
- Rows returned: 1 (Mochi)
- Matched my prediction? no

WHAT I LEARNED
Luna's age is NULL. A NULL age is not "greater than 2", so she is left out.
To include unknown ages I would need: OR age IS NULL.

Ideas for questions to practise

LevelExample question
Starting"List all rows in the table."
Filtering"Which items cost less than 5?"
Sorting"Show the newest five entries."
Counting"How many items are in each category?"
Joining"Show each book with its author's name."
NULLs"Which members have no email recorded?"

How to keep the habit going

Turning the notebook into a reference

After a month, you will have dozens of entries. Add a short index at the top listing topics and entry numbers, for example "GROUP BY: #12, #15, #21". It becomes your personal SQL reference, written in your own words, which is often easier to use than any textbook.

Related pages

Use the beginner's checklist for writing a SELECT while writing each query, and test yourself with Can You Predict What a SELECT Returns?

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.