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 > 80 | Result |
|---|---|---|
| True | True | ✅ Included |
| True | False | ❌ Excluded |
| False | True | ❌ Excluded |
| False | False | ❌ Excluded |
Both must be true!
Multiple ANDs
sql
1SELECT * FROM students
2WHERE course = 'Python'
3AND marks > 80
4AND age > 12;