How to start learning SQL on a small database of your own
Practise on a copy of a small database you understand, using only SELECT at first: choose the fields, the table, a WHERE condition and an ORDER BY. DB Browser for SQLite, the SQL view in Access and LibreOffice Base are free or already installed places to do it, and a read-only habit means nothing can be broken while you learn.
30 October 2026 · 4 min read
Why a small database you already know
SQL is the language almost every database understands for asking questions. Learning it on a sample with a million anonymous rows is harder than it needs to be. On your own shop’s products, or a club’s members, you know what the right answer looks like, so you can tell at once when a query is wrong.
The shape of a question
SELECT name, price FROM products WHERE category = 'Bakery' ORDER BY price DESC;
Read it aloud and it says what it does: give me the name and price from products, only the bakery ones, dearest first. Text goes in single quotes. SELECT * means every field, which is handy for looking and bad for anything you keep.
The next three things to learn
- Totals:
SELECT category, COUNT(*), SUM(stock) FROM products GROUP BY category;gives one row per category. - Two tables:
SELECT p.name, SUM(l.quantity) FROM sale_lines l JOIN products p ON p.id = l.product_id GROUP BY p.name;adds up what each product sold, by following the link from each line to its product. - Names with spaces: standard SQL, SQLite and PostgreSQL put such names in double quotes,
"Reorder Level". Access uses square brackets, and MySQL backticks.
Practising without breaking anything
- Work on a copy. Copy the database file, or export a sample, before you start.
- SELECT reads; the rest writes. UPDATE, DELETE and INSERT change records. A DELETE with no WHERE removes every row in the table.
- Free places to practise: DB Browser for SQLite opens a .db or .sqlite file and has an Execute SQL tab. Access has SQL View on any query. LibreOffice Base has Create Query in SQL View.
- Read the error. A message such as “no such column: prise” is the database telling you exactly what it did not understand.
Our own product, disclosed
Where our own software comes into this
We make Rutba Office, a free desktop suite for Windows. In its Data Files app, a query built by clicking can be opened in SQL view to see the same question written in SQL, and a query can be typed there by hand, run and saved with the others. Field names with spaces go in double quotes, a mistake is named, and the SQL view only reads: nothing typed there can change a record, which makes it a safe place to learn.
Related
What a relational database is, explained with a small shop
A relational database keeps each kind of thing in its own table (customers, products, sales) and links the tables by an ID, so a customer’s address is typed once and every sale points at it. The database refuses a link to a record that does not exist, which a spreadsheet of lookups cannot do.
A free database for a small business, and how to tell you need one
You need a database rather than a spreadsheet once the same customer, product or job is typed into more than one place. Microsoft Access, LibreOffice Base and the SQLite tools keep the records on your own computer for little or nothing; online tools such as Airtable keep them on their servers.
How to work on PostgreSQL or MySQL tables from a desktop database
Keep the records in the server and point a desktop program at its tables. Access does it with linked tables through an ODBC driver, LibreOffice Base connects directly, and tools such as DBeaver edit tables as a grid. Give the program an account of its own with only the rights it needs.
Thirteen apps, one free download
No account, no telemetry, and it works with the network switched off.