Skip
Arish's avatar

23. Combining Conditions with AND


The AND Operator

AND combines multiple conditions. ALL conditions must be true.

Syntax

sql
1SELECT * FROM students
2WHERE condition1 AND condition2;

Example

Find Python students with marks above 80:

sql
1SELECT * FROM students
2WHERE course = 'Python'
3AND marks > 80;

How AND Works

course = 'Python'marks > 80Result
TrueTrue✅ Included
TrueFalse❌ Excluded
FalseTrue❌ Excluded
FalseFalse❌ Excluded

Both must be true!

Multiple ANDs

sql
1SELECT * FROM students
2WHERE course = 'Python'
3AND marks > 80
4AND age > 12;