# Lesson 2: Filtering with WHERE This lesson covers filtering with WHERE. You'll read a short explanation, try three small exercises and finish with a quiz. Read the full lesson: [https://glibcode.net/courses/sql-essentials/lessons/2](https://glibcode.net/courses/sql-essentials/lessons/2) ## Files - `where.sql`: filtering rows with WHERE, AND, IN and LIKE > **Tip:** Count before you delete: run the same WHERE with `SELECT COUNT(*)` first. > **Tip:** Write the FROM and JOIN lines first, then SELECT: it matches how the database reads the query. ## Run it ```sh sqlite3 shop.db < ../../setup/schema.sql sqlite3 shop.db < ../../setup/seed.sql sqlite3 shop.db < where.sql ``` ## Exercises See [exercises.md](exercises.md). Ask in the forum once you've tried.