Stage 2 of 9 · 8 lessons · ~3 weeks
Querying one table
Write SELECT statements against one table: choose columns, filter rows, handle NULL, sort, limit and shape results with expressions and functions.
Start: SELECT, FROM, aliases and DISTINCTLessons· one lesson for each topic, in this order
Do this
- Write queries that select named columns with aliases and DISTINCT.
- Filter with IN, BETWEEN, LIKE and bracketed AND and OR, predicting the row count first.
- Find rows with NULL values and replace NULL with COALESCE.
- Write a paginated query with ORDER BY and a tie-breaker in your dialect.
- Use CASE to label rows and date functions to filter by the last 30 days.
- Solve the first two sections of an online SQL practice set.
Start with· follow one of these
- CoursePaidGrokking SQL for Tech Interviews
Design Gurus · Intermediate · Subscription
The basics, order of execution and functions chapters, each followed by graded problems
- CourseFreeSQLBolt
SQLBolt · Beginner
Free: Lessons 1 to 4, 8, 9 and 12 cover SELECT, filtering, sorting, NULLs, expressions and query order
Practise
Keep handy
Also worth your time
Walks through the logical order a query is evaluated in, which explains most early errors
Before moving on: A file of 30 working single-table queries against your sample database, each with a comment stating the question it answers, including NULL handling, CASE, date filters and a paginated query.

Before you run a query, guess how many rows it will return. The habit of predicting and then checking catches more bugs than any tool, and it is exactly what you need later when joins start multiplying rows.