AND OR NOT operators sql 1

AND OR NOT operators sql

-----------------------SQL AND, OR, NOT OPERATORS------------------------------
AND: this operator displays a record if all conditions seperated by AND are true.
OR: this operator displays a record if any of the conditions seperated by OR is true.
NOT: this operator displays a record if the conditions is Not true.

Here is what the above code is Doing:
1. We are selecting all the columns from the table.
2. We are selecting all the records where the city is either ‘Ahmedabad’ or ‘Mumbai’.
3. We are selecting all the records where the city is ‘Ahmedabad’ and the name is ‘Raj’.
4. We are selecting all the records where the city is not ‘Ahmedabad’.

Similar Posts