SQL AND
Published May 7, 2021Updated May 15, 2024
Contribute to Docs
The AND operator tests if all conditions in a given expression evaluate to TRUE.
Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition1
AND condition2
...
AND conditionN;
If any of the condition_s evaluate to NOT TRUE, then the entire WHERE clause will not return the desired column_s.
Example
The following example filters the current students with GPA higher than 3.0 for the rest of the students table:
SELECT *FROM studentsWHERE enrolled_status = 'current' AND overall_gpa >= 3.0
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn SQL on Codecademy
- Learn to analyze data with SQL and prepare for technical interviews.
- Includes 9 Courses
- With Certificate
- Beginner Friendly.18 hours
- Learn how to query SQL databases and design relational databases to efficiently store large quantities of data.
- Includes 5 Courses
- With Certificate
- Beginner Friendly.13 hours