SQL Quest

Lessons, hints, explained solutions, the in-browser PostgreSQL editor and practice answer checks in your browser are available. Graded assessments, recorded progress from answer checks and new certificates aren't available yet.

SQL Foundations

Start here if you have never written a line of code. You'll learn what a relational database is, how tables, rows, columns and keys fit together, and how to read a schema, then write real queries against a small shop database and a full online store. By the end you can explore an unfamiliar database on your own, return exactly the columns a request asks for, add named calculations, and explain the order in which PostgreSQL evaluates a query.

Lessons

  1. What SQL is and what a database doesMeet databases, tables and SQL, and run your first statement against a real (small) shop database.10 min · 3 exercisesFree
  2. Tables, rows and columnsHow a relational database organises data: tables of rows and typed columns, NULL for missing values, and why data is split across tables.14 min · 4 exercisesFree
  3. Keys and relationshipsPrimary keys identify each row; foreign keys point from one table to another. Follow them by hand to answer real questions.16 min · 4 exercisesFree
  4. Reading a schemaRead a database's structure: its tables, columns, data types, which columns allow NULL, and its keys, by asking the database itself.16 min · 4 exercisesFree
  5. Your first queryAsk the database for specific columns from one table, and read the answer it gives back.12 min · 4 exercisesFree
  6. SQL syntax and styleThe grammar of a SQL statement: keywords, names, text values, quotes, comments and semicolons, and how to format queries other people can read.14 min · 4 exercisesFree
  7. Understanding query resultsRead a result grid like a professional: its shape, column names, data types, NULLs, calculated columns and why row order is not guaranteed.15 min · 4 exercisesFree
  8. Exploring an unfamiliar databaseA repeatable routine for any new database: list the tables, measure them, preview a few rows safely, and find the columns that connect them.18 min · 4 exercisesFree
  9. How a query runsThe logical order in which PostgreSQL evaluates a query (FROM, WHERE, SELECT, ORDER BY, LIMIT), and why it explains common errors.15 min · 4 exercisesFree
  10. Foundations practice setSix realistic requests that combine everything in this track: keys, schema reading, choosing columns, calculated columns, sorting and previewing.22 min · 6 exercisesFree