SQL: free course
Talk to databases: SELECT, WHERE, ORDER BY, functions, GROUP BY and JOIN, on a sample Kenyan shop database.
Start lesson 1 Open the interactive course Printable course notes
Lessons
- 1 What is a database? Tables, rows, keys and SQL
- 2 SELECT: reading data from a table, choosing columns, aliases, calculations and DISTINCT
- 3 WHERE and ORDER BY: filtering rows with conditions, AND/OR, IN, BETWEEN, LIKE and sorting
- 4 Aggregate functions and GROUP BY: COUNT, SUM, AVG, MIN, MAX and summary reports
- 5 CASE, NULL values and HAVING
- 6 Text, number and date functions
- 7 JOIN: combining tables with INNER, LEFT, RIGHT, FULL, self and cross joins
- 8 INSERT, UPDATE and DELETE: adding, changing and removing data safely
- 9 Creating tables: data types and constraints
- 10 Keys, relationships and table design: primary keys, foreign keys, one-to-many, many-to-many and normalisation
- 11 Indexes, transactions and keeping data safe
- 12 Subqueries, CTEs, views and UNION: queries inside queries and reusable results
- 13 Window functions: rankings, running totals and more
- 14 Using SQL from code: Python sqlite3, parameters, SQL injection and connecting apps to MySQL/PostgreSQL
- 15 Project: a business sales report in SQL
- 16 SQL practice workbook and interview questions: 40 problems from easy to hard, with answers