Start this hobby
Your first practical checklist
Buy or borrow
A computer and a browser. Any laptop or desktop will do; many practice sites run in the browser, so there is nothing to install on day one
First 30 minutes
Pick a free browser-based practice site or install SQLite, load a sample database and run SELECT queries to see every table and its columns.
First week goal
Choose one question you actually want answered about the dataset, write the query from scratch, and compare your result with a rough check by eye.
Avoid this mistake
Using SELECT * everywhere hides what you need and slows queries, so name the columns you want.
Is this for me?
A quick fit check
Good signs
- You like questions with a definite answer, such as which five customers spent the most, and enjoy proving your result is right.
- You work with data in spreadsheets and find yourself hitting the limits of filtering, lookups and copying columns around.
- You enjoy puzzles that you can solve step by step, building a complicated query out of small, simple pieces.
Think twice if
- SQL is a language for asking questions, not a tool for pretty charts, so you will often need other software to present what you find.
- Different databases such as SQLite, PostgreSQL and MySQL use slightly different dialects, so a query that works in one may need a tweak in another.
- Practice questions can feel abstract without a personal reason to learn, and many people stall at joins and aggregates unless they work on a topic they care about.
Make SQL practice easier
Use a free browser-based practice site with guided exercises, or follow a free tutorial and keep a single sample database you find interesting, so there is nothing to install and nothing you can break.
First session
What to do in the first 30 minutes
Open a practice site or install a local database, load a sample dataset and list its tables.
Run SELECT * FROM a table with LIMIT 10 to see the columns, then swap the star for the specific columns you want.
Add a WHERE clause to filter rows, such as films released after a given year, then sort the results with ORDER BY.
Use COUNT to find how many rows match, and save your best three queries with a note on what each one does.
The appeal · Digital practice
Why try SQL practice?
SQL practice means writing small queries against sample databases, so that you can pull, filter, join and summarise data in tables, rather than clicking through a spreadsheet. It overlaps with spreadsheets and with data work in a language such as Python, but SQL is the language most relational databases use to answer questions, so it travels with you. Beginners usually start with a free practice site and one sample database, move from single-table queries to joins and grouping, and then design their own tables and tackle trickier problems such as window functions.
Answering your own questions
You can pull exactly the rows you need from large tables instead of scrolling or filtering by hand.
A transferable language
The same core SQL works in most relational databases, so what you learn applies to many tools and projects.
Clear, checkable puzzles
Each query has a right answer, so you can see your progress as exercises that once stumped you become easy.
Keep it simple
What you need to begin
- A computer and a browserAny laptop or desktop will do; many practice sites run in the browser, so there is nothing to install on day one
- A free local database such as SQLiteA single small database that runs on your own machine, handy for experimenting without the risk of changing anything important
- A sample database to queryA practice dataset about films, shops or football gives you realistic tables to join; choose something you find interesting so questions are fun
- A text file or notebook of queriesSave the queries you write, with a note of what each one does, so you can look back and spot your own patterns
The fundamentals
Four skills to build
SELECT, WHERE and ORDER BY
These three clauses let you choose columns, filter rows and sort results, and they are the foundation of nearly every query you will write.
JOINs
Combining tables on a shared key lets you answer questions that span customers, orders and products, and understanding INNER versus LEFT joins stops you losing or duplicating rows.
GROUP BY and aggregates
COUNT, SUM and AVG with GROUP BY let you summarise data by category, which is where most real questions end up.
Reading and debugging queries
Checking row counts, breaking a long query into steps and handling NULL values correctly are what separate working queries from plausible-looking wrong ones.
Four small steps
Your first week
- Pick a free browser-based practice site or install SQLite, load a sample database and run SELECT queries to see every table and its columns.
- Write 10 queries using WHERE, ORDER BY and LIMIT on a single table, such as the five most expensive products or customers from a particular city.
- Learn INNER JOIN and LEFT JOIN by linking two tables, then use GROUP BY with COUNT and SUM to answer questions like how many orders each customer made.
- Choose one question you actually want answered about the dataset, write the query from scratch, and compare your result with a rough check by eye.
The longer path
How progress usually looks
For sql practice, a sustainable rhythm is 20 to 30 minutes most days, or two or three hours across a week. Move forward when the current step feels repeatable, not merely possible once.
Single-table queries
You can select, filter, sort and count rows in one table and explain what each clause does.
Joins and summaries
You combine two or three tables, group results and filter groups with HAVING, and sanity-check row counts.
Subqueries, CTEs and window functions
You break complex questions into steps with common table expressions and use window functions such as ranking and running totals.
Design and performance
You create your own tables with keys, add indexes, read an execution plan and design a small database for a real project.
Progress markers
What improvement looks like
You can select, filter, sort and count rows in one table and explain what each clause does.
You break complex questions into steps with common table expressions and use window functions such as ranking and running totals.
You create your own tables with keys, add indexes, read an execution plan and design a small database for a real project.
Spend deliberately
A realistic cost plan
The headline starting range is Free, but access, borrowing and second-hand equipment can change that substantially.
Learn with other people
Community and safety
Finding your people
Online forums, question-and-answer sites and learning communities are where most beginners compare answers. Local data and coding meetups around the UK often welcome newcomers who want to practise on real datasets.
Safety note
Never practise on a live work or customer database; use sample data or a copy, and run SELECT before UPDATE or DELETE. If you build a project with real people's details, treat it as personal data under UK data-protection law and use made-up records for practice instead.
Three common beginner mistakes
- Using SELECT * everywhere hides what you need and slows queries, so name the columns you want.
- Writing WHERE column = NULL returns nothing because NULL is not a value to compare, so use IS NULL or IS NOT NULL.
- Trusting a result because the query ran without errors misses silent mistakes, so check row counts, compare against a small manual check and look for duplicated rows after joins.
Good to know
One tip worth keeping
The most common mistake is joining tables without an ON condition or running UPDATE and DELETE without a WHERE clause, which multiplies or destroys rows. Practise on sample data or a copy, run your SELECT first to see which rows you will change, and never experiment on a live work database.
Before you begin
Common questions
Do I need to know how to code to learn SQL?+
No. SQL reads a lot like English sentences, and you can start with queries on day one. Some programming knowledge helps later if you use SQL inside scripts or applications, but it isn't a prerequisite.
Which database should I start with?+
SQLite is simple, free and runs on your own machine, while browser-based practice sites need no installation. PostgreSQL is a popular next step; the core SQL is the same across most of them.
How long does it take to learn SQL?+
Most people can write useful single-table queries within a week or two of regular practice, and joins and grouping take a few weeks more. Window functions and database design are worth building up over months.
What is the difference between SQL and Excel?+
A spreadsheet suits small amounts of data you edit by hand, while SQL is built to ask questions of large tables stored in a database and to join them together. Many people use both.
Where can I find data to practise on?+
Practice sites come with sample databases, and many public bodies publish open datasets in CSV that you can import into a local database. Choose a topic you enjoy, such as sport or films, so the questions stay interesting.