AND OR NOT in SQL

HOW TO USE SQL AND, OR, NOT OPERATORS?

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>;


Posted

in

Tags:

Comments

Leave a Reply