Learn to retrieve exactly the data you need from a PostgreSQL database using SELECT, WHERE, ORDER BY and friends. You will filter rows precisely, handle NULLs safely, match text patterns, and shape result sets so a query returns the right columns in the right order.
Watch the free preview
Your first SELECT — columns, aliases and FROM — free to watch, no account needed.
What you'll learn
- Retrieve exactly the data you need with precise SELECT queries
- Filter rows using comparison and logical operators in WHERE
- Sort, page and de-duplicate results with ORDER BY, LIMIT/OFFSET and DISTINCT
- Match text with LIKE and ILIKE pattern searches
- Handle NULLs safely using IS NULL and COALESCE
Syllabus
Reading Data with SELECT
Your first SELECT — columns, aliases and FROMFree preview
DISTINCT and ORDER BY — de-duplicating and sorting
Filtering Rows with WHERE
WHERE — comparison and logical operators
LIMIT and OFFSET — capping and paging results
Text Patterns and Missing Values
Pattern matching with LIKE and ILIKE
NULL handling with IS NULL and COALESCE
Composing Precise Queries
The full query — clause order and how it fits together
A realistic retrieval — building a precise result set
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10