0% found this document useful (0 votes)
60 views

SQL Tutorial - Logical OR Operator

The document discusses logical operators in SQL - AND, OR, and NOT. The AND operator returns true if both conditions are true, OR returns true if either condition is true, and NOT inverts the following condition, returning true if it is false. Examples are given showing how to use each operator to filter employee records based on salary conditions.

Uploaded by

jaggu011
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

SQL Tutorial - Logical OR Operator

The document discusses logical operators in SQL - AND, OR, and NOT. The AND operator returns true if both conditions are true, OR returns true if either condition is true, and NOT inverts the following condition, returning true if it is false. Examples are given showing how to use each operator to filter employee records based on salary conditions.

Uploaded by

jaggu011
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

 Chapter 12: Logical Operators

SQL Tutorial - Logical AND Operator


The Logical AND operator:
Logical Operator AND
Returns ‘True’ if both component conditions are true. Returns ‘False’ if any one component
condition or Both Component conditions are False.

Example:-
Display the details of Employees whose salary is Greater than 1000 AND also whose salary is
less than 2000.

SQL> SELECT *FROM emp WHERE sal > 1000 AND sal <2000;

SQL Tutorial - Logical OR Operator

The Logical OR operator:


Returns True if either component conditions become TRUE. Returns False if both the component
conditions becomes False.

Example:
Display the details of Employees whose salary is Greater than 1000 OR also whose salary is less
than 2000.

SQL> SELECT *FROM emp WHERE sal> 1000 OR sal < 2000;
SQL Tutorial - Logical NOT Operator

The Logical NOT operator:


The NOT operator returns ‘True’ if the condition is False and returns ‘False’ if the following
condition is True.

Example:
Display the details of employees whose salary is Greater than or Equals to 3000.

SQL> SELECT * FROM emp WHERE sal < 3000;

You might also like