Advertisement

Google Ad Slot: content-top

MySQL Operators


MySQL Operators

Operators in MySQL are used to perform operations on data. They are essential in queries for performing calculations, comparisons, logical operations, and more.

MySQL Arithmetic Operators

Operator

Description

Example

+

Addition

Tryit yourself

-

Subtraction

Tryit yourself

*

Multiplication

Tryit yourself

/

Division

Tryit yourself

%

Modulus (Remainder)

Tryit yourself

MySQL Bitwise Operators

Operator

Description

&

Bitwise AND

|

Bitwise OR

^

Bitwise XOR

MySQL Comparison Operators

Operator

Description

Example

=

Equal to

Tryit yourself

!=

Not equal to

Tryit yourself

<

Less than

Tryit yourself

>

Greater than

Tryit yourself

<=

Less than or equal to

Tryit yourself

>=

Greater than or equal to

Tryit yourself

MySQL Compound Operators

Operator

Description

+=

Add and assign

-=

Subtract and assign

*=

Multiply and assign

/=

Divide and assign

%=

Modulus and assign (Remainder)

MySQL Logical Operators

Operator

Description

Example

AND

Returns TRUE if both conditions are true

Tryit yourself

OR

Returns TRUE if at least one condition is true

Tryit yourself

NOT

Reverses the result of a condition

Tryit yourself