-
-
Sure! Here is a list of common SQL operators, categorized for better understanding:
Arithmetic Operators
- Addition (
+
): Adds two values. - Subtraction (
-
): Subtracts one value from another. - Multiplication (
*
): Multiplies two values. - Division (
/
): Divides one value by another. - Modulus (
%
): Returns the remainder of a division.
Comparison Operators
- Equal to (
=
): Checks if two values are equal. - Not equal to (
<>
or!=
): Checks if two values are not equal. - Greater than (
>
): Checks if one value is greater than another. - Less than (
<
): Checks if one value is less than another. - Greater than or equal to (
>=
): Checks if one value is greater than or equal to another. - Less than or equal to (
<=
): Checks if one value is less than or equal to another.
Logical Operators
- AND: Returns true if all conditions are true.
- OR: Returns true if any condition is true.
- NOT: Reverses the result of a condition.
Bitwise Operators
- Bitwise AND (
&
): Performs a bitwise AND operation. - Bitwise OR (
|
): Performs a bitwise OR operation. - Bitwise XOR (
^
): Performs a bitwise XOR operation. - Bitwise NOT (
~
): Performs a bitwise NOT operation. - Bitwise Shift Left (
<<
): Shifts bits to the left. - Bitwise Shift Right (
>>
): Shifts bits to the right.
Other Operators
- IN: Checks if a value is within a set of values.
- BETWEEN: Checks if a value is within a range.
- LIKE: Searches for a specified pattern in a column.
- IS NULL: Checks if a value is NULL.
- IS NOT NULL: Checks if a value is not NULL.
- EXISTS: Checks if a subquery returns any rows.
These operators are fundamental in SQL and are used to perform various operations on data within a database. If you need more specific examples or further details, feel free to ask!
- Addition (