Mon. Jan 23rd, 2023

Relational Operators

These are the operators that compare two values. Regardless of the comparison being performed, they all return a boolean value – either true or false. “first value” refers to the left-hand value, and “second value” refers to the right-hand value.

==

Compare for equality. Returns true if both values are the same, false otherwise

<

Returns true is the first value is less than the second one, false otherwise (including if the values are equal)

>

Returns true if the first value is greater than the second one, false otherwise (including in cases of quality)

<> or !=

Compare for inequality; this returns true if the values are not equal, false otherwise

<=

Returns true if the first value is either less than or equal to the second, and false if the first value is greater than the second

>=

Returns true if the first value is greater than or equal to the second, and false if the first value is less than the second