Loading

MySQL Operators

MySQL Operators:- Operators are basically used to modify information of the group of data, So They apply conditions with the “WHERE” clause. In MySQL, we can use different types of operators. Hence, We can say that operators are used for Searching, Sorting, and Filtering data.
On the basis of the uses of operators, we can put MySQL operators in the following category.
1. Arithmetic Operators
2. Bitwise Operators
3. Comparison Operators
4. Compound Operators
5. Logical Operators
1. Arithmetic Operators:- Arithmetic Operators are + (Add), – (Subtract), * (multiply), / (Divide), and % (Modulo).
Example:- a= 20 and b= 5
then, a+b = 25
a-b = 15
a*b = 100
a/b = 4
a%b = 0
2. Bitwise Operators:- Bitwise Operators are & (Bitwise AND), ! (Bitwise OR), ! (Bitwise Exclusive OR).
3. Comparison Operators:- Comparison Operators are = (Equal to), > (Greater Than), < (Less Than), <>(NOT Equal to), >= (Greater Than or Equal to), <= (Less Than or Equal to), !< (Not Less Than), !>(Not Greater Than)
4. Compound Operators:- Compound Operators are += (Add Equal), -= (Subtract Equal), *= (Multiply Equal), /= (Divide Equal), %= ( Modulo Equal), &= (Bitwise AND Equal), ^-= ( Bitwise Exclusive Equals), !*= (Bitwise OR Equals).
5. Logical Operators:-
All:- If all subquery values meet the condition then It returns true.
AND:- If both the condition will be true then it returns true.
ANY:- In a given condition, If any of the subquery values will match then it will return true.
BETWEEN:- The “BETWEEN.” operator helps to Match numerical values. It returns a value within a set of values. That means it returns true if the operand is within the range of comparisons.
EXISTS:- EXISTS operator checks if data is available or not available. That means, If in a given certain condition It searches each row of subquery for the presence of data, If it will find one or more value then it will return true.
IN:- It searches for a value in a given list of literal values. That means, if the operand is equal to one of a list of expressions then it will return true.
IS NULL:- It checks particular column is NULL.
IS NOT NULL:- It checks particular column is NOT NULL.
LIKE:- If in a given pattern value is available then it will return true.
NOT:- If the given condition or conditions is NOT TRUE then it returns true. That means It reverses the meaning of the logical operator, like NOT BETWEEN, NOT EXIST, NOT IN, NOT LIKE, etc.
OR:- If any one condition is true then it returns true.
SOME:- if any of the subquery values meet the condition then It will return true.
UNIQUE:- It searches for every row of a specified table for no duplication.

Share with:


Leave a Reply

Connect with:





z35W7z4v9z8w