MiniCTRMSearch

MiniCTRM - Tutorial: Intro to SQL - Power

→ to begin · N for the speaker notes

On a phone: Next or a swipe left to begin, Notes for the words.

What you'll learn

  • Asking for rows – SELECT, FROM, the star, AS and DISTINCT.
  • Choosing rows – WHERE, AND and the comparisons, IN, BETWEEN, and NULL.
  • Sorting – ORDER BY and DESC.
  • Counting and adding up – COUNT, GROUP BY, SUM, ROUND and arithmetic.
  • Joining tables – JOIN and ON, LEFT JOIN, and COALESCE.
  • Shaping the answer – CASE, CAST and LENGTH.
  • Bigger queries – WITH, UNION ALL, WITH RECURSIVE, OVER, and a script's question mark.
  • SQLite's own words – date, strftime, julianday, typeof, sqlite_version and pragma_foreign_key_list.
  • Other databases – Standard SQL and dialects: SQLite, PostgreSQL and Microsoft SQL Server.

Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.

Welcome

Intro to SQL

1 / 34
Intro to SQL
Welcome

Tables, rows and columns

2 / 34
Tables, rows and columns
Asking for rows

SELECT and FROM

3 / 34
SELECT and FROM
Asking for rows

Read the answer

4 / 34
Read the answer
Asking for rows

Naming the columns

5 / 34
Naming the columns
Asking for rows

AS: a name for the answer's column

6 / 34
AS: a name for the answer's column
Asking for rows

DISTINCT: each value once

7 / 34
DISTINCT: each value once
Choosing rows

WHERE: only the rows you want

8 / 34
WHERE: only the rows you want
Choosing rows

AND, and the comparisons

9 / 34
AND, and the comparisons
Choosing rows

IN: one of a list

10 / 34
IN: one of a list
Choosing rows

BETWEEN, and dates

11 / 34
BETWEEN, and dates
Choosing rows

NULL, IS NOT NULL and NOT

12 / 34
NULL, IS NOT NULL and NOT
Sorting

ORDER BY and DESC

13 / 34
ORDER BY and DESC
Counting and adding up

COUNT

14 / 34
COUNT
Counting and adding up

GROUP BY

15 / 34
GROUP BY
Counting and adding up

SUM, ROUND and arithmetic

16 / 34
SUM, ROUND and arithmetic
Joining tables

Tables point at each other

17 / 34
Tables point at each other
Joining tables

JOIN and ON

18 / 34
JOIN and ON
Joining tables

LEFT JOIN

19 / 34
LEFT JOIN
Joining tables

COALESCE

20 / 34
COALESCE
Shaping the answer

CASE, WHEN, THEN, ELSE and END

21 / 34
CASE, WHEN, THEN, ELSE and END
Shaping the answer

CAST

22 / 34
CAST
Shaping the answer

LENGTH

23 / 34
LENGTH
Bigger queries

WITH: a query in steps

24 / 34
WITH: a query in steps
Bigger queries

UNION ALL

25 / 34
UNION ALL
Bigger queries

WITH RECURSIVE: rows nobody stored

26 / 34
WITH RECURSIVE: rows nobody stored
Bigger queries

OVER: a running total

27 / 34
OVER: a running total
Bigger queries

A question mark in a script

28 / 34
A question mark in a script
SQLite's own words

date, strftime, julianday and typeof

29 / 34
date, strftime, julianday and typeof
SQLite's own words

sqlite_version()

30 / 34
sqlite_version()
SQLite's own words

pragma_foreign_key_list

31 / 34
pragma_foreign_key_list
Other databases

Other databases, other dialects

32 / 34
Other databases, other dialects
Other databases

The same question, three spellings

33 / 34
The same question, three spellings
What next

Where to go from here

34 / 34
Where to go from here

You have finished lesson 404, Intro to SQL.

Where next?

← → move · N notes · Home / End