MarzleyTech Learn

Home / Learn / SQL

SQL: free course

Talk to databases: SELECT, WHERE, ORDER BY, functions, GROUP BY and JOIN, on a sample Kenyan shop database.

16 lessons · free · no account needed · code examples, practice questions and videos

Start lesson 1 Open the interactive course Printable course notes

Lessons

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