In SQL, operators are symbols or keywords used to perform operations on data. Here's a rundown of some common SQL operators:
'+' (Addition)
'-' (Subtraction)
'*' (Multiplication)
'/'(Division)
'%' (Modulus)
Comparison Operators:
'=' (Equal to)
'!=' or '<>' (Not equal to)
'<' (Less than)
'>' (Greater than)
'<=' (Less than or equal to)
'>=' (Greater than or equal to)
Logical Operators:
AND (Logical AND)
OR (Logical OR)
NOT (Logical NOT)
Concatenation Operator:
|| (Used to concatenate strings in some SQL dialects like Oracle)
Pattern Matching Operators:
LIKE (Matches a pattern)
IN (Matches any value in a list)
BETWEEN (Matches a range)
NULL-related Operators:
IS NULL (Tests for NULL values)
IS NOT NULL (Tests for non-NULL values)
Aggregate Functions:
COUNT() (Counts the number of rows)
SUM() (Calculates the sum of values)
AVG() (Calculates the average)
MIN() (Finds the minimum value)
MAX() (Finds the maximum value)
Assignment Operator:
= (Assigns a value to a variable)
These are the fundamental operators used in SQL queries to perform various operations like filtering data, performing calculations, and more.