Querying Data · 7 min read · Beginner
SELECT & Filtering with WHERE
Query specific columns from relational tables and filter rows with WHERE, AND, OR, and LIKE.
What you'll learn
- Select specific columns instead of SELECT * for cleaner queries
- Filter rows using WHERE with comparison operators (=, >=, <>)
- Match text patterns using LIKE with the % wildcard
SQL (Structured Query Language) is the universal language for working with relational databases like PostgreSQL, MySQL, and SQLite.
Anatomy of a Basic Query
SELECT title, track, lessons
FROM courses
WHERE lessons >= 10;
Fill-in-the-Blank Exercise
Filter Free Courses
Select the title and track from courses where lessons is at least 10.
title, track
courses
lessons >= 10;Try It Yourself (Live In-Browser SQLite)
Click Run SQL to query a live SQLite database right inside your browser! Try changing >= 10 to < 10 or filtering by track = 'SQL'.
SQLQuery the Courses Table
Query Result (In-Browser SQLite)
Click Run SQL to execute this query against a live in-browser SQLite database.
Check Your Understanding
Score: 0 / 1
1. Which SQL clause filters which rows are returned by a SELECT query?
Study Workspace
Finished this lesson?
Your progress is saved locally in your browser, no account needed.