HOW TO USE SQL AND, OR, NOT OPERATORS

AND OR NOT SQL OPERATOR

AND Operator IN SQL

The AND operator displays a record if all the conditions separated by AND are TRUE.

Syntax-

SELECT column1, column2, columnN

FROM <table_name>

WHERE <condition1>AND <condition2>…AND <conditionN>;

OR OPERATOR IN SQL

The OR operator displays a record if any of the conditions separated by OR is TRUE.

Syntax-

SELECT column1, column2, columnN

FROM <table_name>

WHERE <condition1> OR <condition2>…OR <condition>;

NOT OPERATOR IN SQL

The NOT operator displays a record if the condition(s) is NOT TRUE.

Syntax-

SELECT column1, column2, columnN

FROM <table_name>

WHERE NOT<condition1>;


Leave a Reply

Your email address will not be published. Required fields are marked *