AND, OR, NOT
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
Combining conditions
A WHERE clause can test more than one thing at once. Join conditions with:
AND— both must be trueOR— at least one must be trueNOT— flips a condition
SELECT name FROM student WHERE form = '11A' AND score > 88;
This returns 11A students who also scored above 88.
Mixing AND and OR
When you mix AND and OR, use brackets to make the meaning clear, just like in maths:
SELECT name FROM student
WHERE form = '11B' OR score >= 95;
AND is checked before OR, so brackets remove any doubt about what you mean.
Common mistakes
- Use brackets when you mix
ANDandORto make the order clear. NOTreverses a condition.
Explore · 탐색하기
AND, OR, NOT
Combine conditions with AND/OR/NOT — see the truth table.
Show the name of every student who is in form 11A and scored more than 88.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Show the name of every student who is in form 11B or scored 95 or more.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.