Oracle: Logical AND Operator

The Logical AND Operator in Oracle helps to join two or more different Boolean expressions and returns TRUE if all the expressions are true. To understand the concept more clearly follow the table below:

CONDITION_1CONDITION_2CONDITION_1 AND CONDITION_2
TrueTrueTRUE
True FalseFALSE
FalseTrueFALSE
False FalseFALSE

Syntax

Condition1 AND Condition2;

Example

We have a Stu Table as follows:


Oracle: Logical AND Operator

NOTE: Table Stu has 2 entries with the name Radha. However, Roll_no is different in both entries.

Now to apply AND Operator, let's follow the code as below:

select * from Stu where Name='Radha' AND Roll_no='180';

There are 2 expressions given in the above code:

  1. We need to find the values where name is Radha.
  2. With the name Radha, must have 180 as a Roll_no.

It will function as:

Oracle: Logical AND Operator

Also, we all know that Logical AND returns Values that have both conditions as TRUE

Output

Oracle: Logical AND Operator