MySQL SQLLesson 46Free preview
MySQL Operators
This lesson is part of MySQL · All levels
Summary
MySQL supports a wide variety of operators, from arithmetic operators, comparison operators, logic operators, to special operators such as IN, BETWEEN, LIKE, and <=>. Each operator helps to set the query conditions correctly in the WHERE clause and other expressions. Understanding the character of each operator prevents logical errors that often occur in combined conditions.
Key points
- Comparison operators: =, <>,!=, <, >, <=, >=, and <=> for NULL-safe comparison
- Logic operator: AND, OR, NOT to combine the conditions
- Special operators: IN, BETWEEN, LIKE, IS is not
- Arithmetic operator: +, -, *, /, % (modulus)
- The operator <=> treats NULL = NULL as TRUE, as opposed to the usual =
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.