💻
← All courses
SQL Beginner Course: 12 Free Lessons With a Practice Database
📘 12 / 12 lessons⬇️ 12 practice files🌱 Beginner💸 Free
SQL is how you ask questions of data stored in databases: ERP systems, billing software, websites, data warehouses. If you can write a SUMIFS in Excel, you can learn SQL; it’s the same thinking with different words.
The course uses one small practice database, shop.db (customers, products, orders), that runs in the free DB Browser for SQLite with nothing to install on a server. Every lesson has an exercise file with expected results, so you can check yourself.
- 1SQL Lesson 1: SELECT — Reading DataYour first SQL queries: what tables, rows and columns are, install DB Browser for SQLite, SELECT columns, SELECT *, calculated columns with…
- 2SQL Lesson 2: WHERE — Filtering RowsFilter rows in SQL with WHERE: comparison operators, AND/OR with brackets, IN, BETWEEN, LIKE with % and _, and IS NULL —…
- 3SQL Lesson 3: ORDER BY and LIMITSort SQL results with ORDER BY, ascending and descending, by several columns and by calculated values; get top-N lists with LIMIT, and…
- 4SQL Lesson 4: COUNT, SUM, AVG, MIN and MAXSummarise data with aggregate functions: COUNT(*) vs COUNT(column), SUM, AVG with ROUND, MIN and MAX on numbers and dates, filtering before aggregating,…
- 5SQL Lesson 5: GROUP BY and HAVINGGet totals per group with GROUP BY — customers per region, orders per status, sales per month — filter groups with HAVING,…
- 6SQL Lesson 6: JOINs — Combining TablesCombine tables with JOIN: primary and foreign keys, INNER JOIN, table aliases, joining three tables, LEFT JOIN to find missing matches, and…
- 7SQL Lesson 7: SubqueriesUse a query inside a query: compare with an average, filter with IN and NOT IN, find the row with the maximum,…
- 8SQL Lesson 8: CASE — If-Then in SQLUse CASE to label rows (price bands, order sizes), count conditions side by side with SUM(CASE…), handle NULLs with readable labels, and…
- 9SQL Lesson 9: Working With DatesFilter and group by dates in SQL: ISO date format, month and year ranges, strftime/date functions in SQLite (and SQL Server/PostgreSQL equivalents),…
- 10SQL Lesson 10: INSERT, UPDATE and DELETE SafelyChange data without disasters: INSERT rows, UPDATE with a WHERE you have tested, DELETE carefully, transactions with BEGIN/ROLLBACK/COMMIT, and habits that prevent…
- 11SQL Lesson 11: ViewsSave a query as a view: build an order_lines view joining orders, customers and products, query it like a table, use views…
- 12SQL Lesson 12: Project — A Sales Report in SQLPut the course together: build a half-year sales report from shop.db with total sales, GST, top customer, best month, cancellation rate and…
Next: the Python course, and see all SQL posts.