Select Chapter ❯
MySQL Tutorial
MySQL Operators
MySQL has different kinds of operator for different kind of purposes.Operators are very helpful they can make querying a database very easy.
- " = " Operator it is equal to operator
- " < " Operator it is less than operator
- " > " Operator it is greater than operator
- " <= " Operator it is less than or equal to operator
- " >= " Operator it is greater than or equal to operator
- " != " Operator it is Not equal to operator
- " AND " Operator
- " OR " Operator
- " NOT " Operator
- " IN " Operator it is used to compare and find that the value is in list of expressions.In the bracket we use expressions
- " BETWEEN " Operator
- " LIKE " Operator you can use % and - with LIKE operator
WHERE student_name = 'Rahul'
WHERE student_id < '2'
WHERE student_id > '5'
WHERE student_id <= '3'
WHERE student_id >= '3'
WHERE student_id != '3'
WHERE student_id = '3' AND student_name = 'Rahul'
WHERE student_id = '3' OR student_id = '5'
WHERE NOT student_id = '3'
WHERE student_id IN (1,2,3)
WHERE student_id BETWEEN '3' AND '5'
/* It displays all the results where student_name is starting from Rah*/ WHERE student_name LIKE 'Rah%' or /* It displays all the results where student_name is ending from hul*/ WHERE student_name LIKE '%hul'