SQL – AND
Combine multiple conditions in a WHERE clause using AND to require all conditions to be true simultaneously.
Table of Contents
The AND operator lets you stack multiple conditions in a single WHERE clause. A row is only included in the results if every condition connected by AND is true. Think of it as a checklist — every item on the list must be checked off for the row to pass.
This is enormously useful for precision filtering. Instead of finding all students from Mumbai and then manually filtering for those with an A grade, you write one query that does both at once with crystal-clear intent.
Syntax
SELECT * FROM students
WHERE city = 'Mumbai'
AND grade = 'A'
AND score > 90;
All three conditions must be true for a row to appear.
Try It Yourself — Interactive SQL Editor
Edit the query below and click Run Query ▶ to see live results powered by SQLite running directly in your browser.
Key Points
- AND requires ALL conditions to be true
- Chain as many conditions as needed
- Use parentheses to control evaluation order: (A AND B) OR C
- AND is evaluated before OR in SQL — parentheses clarify intent
Pro Tip from CodesCompiler: The best way to learn SQL is to break things intentionally — modify the query above, change the WHERE conditions, try different columns. Every error teaches you something the docs cannot.
In the next lesson, we continue exploring SQL’s powerful feature set to build your database mastery.