SQL for Beginners
Ask real questions of real data, from your first SELECT to a full sales report
A free, complete SQL course for absolute beginners. Using a small online shop's database, learn to select, filter, sort and summarise data, join tables, find missing records and change data safely. Every lesson has runnable queries with results, exercises with solutions and a quiz. Finish by building a sales report with written recommendations.
- lessons
- 12
- lessons
- final project
- 1
- final project
- of learning
- 7 hours
- of learning
- level
- Beginner
- level
Who this course is for
- Complete beginners: no coding experience needed
- Aspiring data analysts, business analysts and testers
- Developers and students who want to understand databases
- Office workers who want answers faster than spreadsheets allow
What you will be able to do
- Explain tables, rows, columns, primary keys and foreign keys
- Write queries that select, filter, sort and limit data
- Summarise data with COUNT, SUM and AVG, per group with GROUP BY
- Combine tables with INNER JOIN and LEFT JOIN, and find missing records
- Use subqueries and CASE for more advanced questions
- Create tables and insert, update and delete data safely
- Turn business questions into a checked report with recommendations
Before you start
Skills you need
- Basic computer use: downloading and installing a program, saving files
- No coding or maths beyond simple arithmetic and percentages
Cost and accounts
Free. No account, card or server needed.
Setup time
About 15 minutes to install DB Browser for SQLite and load the sample database (lesson 1).
Tools
- DB Browser for SQLite 3.13 or newer ↗Free and open source, for Windows, macOS and Linux. Lesson 1 walks you through it.
- The sample database script (shop.sql)Download it in lesson 1. All the data is made up.
- A Windows, macOS or Linux computerYou can read on a phone, but you need a computer to practise.
Checked with
- SQLite 3.51: every query is run against the sample database and its result checked before publishing
- DB Browser for SQLite 3.13.1 steps checked against its official download page and wiki on 2026-11-25
Last reviewed: 25 November 2026
Syllabus
Module 1: Your first queries
Set up a database, then select, filter and sort data, and handle missing values.
- 1Databases, tables and your first SQL queryLearn what a database, a table and SQL are, set up the free DB Browser for SQLite with the course's sample shop database, and run your first SELECT query.30 min
- 2SELECT: choosing the columns you needChoose specific columns with SQL SELECT, rename them with AS, calculate new columns such as price with GST, and write readable queries with comments.20 min
- 3WHERE: filtering rowsFilter SQL results with WHERE: compare numbers, text and dates, combine conditions with AND and OR, and use IN, BETWEEN and LIKE pattern matching.30 min
- 4Sorting, limiting and removing duplicatesSort SQL results with ORDER BY (ascending, descending and by several columns), show only the top rows with LIMIT, and list unique values with DISTINCT.20 min
- 5NULL: working with missing valuesUnderstand SQL NULL values, find them with IS NULL and IS NOT NULL instead of =, and replace them in results with COALESCE.20 min
Module 2: Summarising data
Turn many rows into answers: totals, averages and per-group summaries.
- 6Summarising data: COUNT, SUM, AVG, MIN and MAXSummarise many rows into one answer with SQL aggregate functions COUNT, SUM, AVG, MIN and MAX, count distinct values, and combine aggregates with WHERE.25 min
- 7GROUP BY and HAVING: summaries for each groupUse SQL GROUP BY to get one summary row per group (per country, category or status), filter groups with HAVING, and learn the order in which SQL runs each clause.30 min
Module 3: Combining tables
Keys, joins, missing matches, subqueries and CASE.
- 8Keys and relationships between tablesUnderstand why databases split data across tables, how primary keys and foreign keys link them, and how to read a simple database diagram of one-to-many relationships.20 min
- 9JOIN: combining tablesCombine rows from two or three SQL tables with INNER JOIN and ON, use table aliases, and join then group to calculate spending per customer.35 min
- 10LEFT JOIN: keeping rows without a matchKeep every row from one table with SQL LEFT JOIN, find customers with no orders and products never sold, and count correctly so that zero shows as 0.25 min
- 11Subqueries and CASE: questions inside questionsUse a SQL subquery to compare with an average or filter with IN, and use CASE expressions to label rows and count conditions inside aggregates.30 min
Module 4: Creating and changing data
Build tables and change data with safety habits that protect real systems.
Module 5: Final project
Answer a business owner's questions and explain what the data means.
Final project
Sales report for an online shop
Answer seven business questions with SQL, check that the numbers reconcile, and write a short summary with recommendations.
You complete the course when every lesson is marked complete and your project passes its self-check rubric.
Prerequisites
None. This course starts from zero.
This course prepares you for
- Python for Beginners · Python lets you automate the queries and reports you can now write by hand.