Lesson 14 of 30
Dates
Today at the studio
In the story of this course, today is 2026-11-01, a Sunday. The schedule board says Moonlit Ramen airs on Saturdays, and a rerun block is coming. Rin asks you to turn the pile of date strings into answers.
The idea
SQLite keeps dates as text in the form '2026-11-01'. Because of that form, you can compare dates with <, > and BETWEEN.
strftime(format, date) picks parts of a date: '%Y' is the year, '%m' the month, '%w' the weekday number with 0 for Sunday. date(d, '+7 days') moves a date by an amount. The function result is text.
Example
SELECT title, air_date FROM episodes WHERE air_date >= date('2026-11-01', '-14 days')Your turn
0 of 4 questions
Question 1 of 4
Which episodes aired in October 2026? Show title and air_date.