bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL Operators

SQL operators are keywords and symbols used to perform operations with data values.

SQL operators are used in SQL statements like SELECT , WHERE , LIKE , etc.

SQL operators is categorized into the following types:

  • Arithmetic operators
  • Comparison operators
  • Compound operators
  • Bitwise operators
  • Logical operators

SQL Arithmetic Operators

OperatorDescriptionExample
+Addition
-Subtraction
*Multiplication
/Division
%Modulus

SQL Comparison Operators

OperatorDescriptionExample
=Equal to
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to
<>Not equal to

SQL Compound Operators

OperatorDescription
+=Add equals
-=Subtract equals
*=Multiply equals
/=Divide equals
%=Modulo equals
&=Bitwise AND equals
^=Bitwise exclusive equals
*=Bitwise OR equals

SQL Bitwise Operators

OperatorDescription
&Bitwise AND
Bitwise OR
^Bitwise exclusive OR
~Bitwise NOT

SQL Logical Operators

OperatorDescriptionExample
ALLTRUE if all of the subquery values meet the condition
ANDTRUE if all the conditions separated by AND is TRUE
ANYTRUE if any of the subquery values meet the condition
BETWEENTRUE if the operand is within the range of comparisons
EXISTSTRUE if the subquery returns one or more records
INTRUE if the operand is equal to one of a list of expressions
LIKETRUE if the operand matches a pattern
NOTDisplays a record if the condition(s) is NOT TRUE
ORTRUE if any of the conditions separated by OR is TRUE
SOMETRUE if any of the subquery values meet the condition

Previous

SQL Comments

Next chapter

SQL Database

Start with SQL CREATE DATABASE Statement

This chapter

Overview
46

Lessons

115m

Read time

1. SQL Tutorial2. Introduction to SQL3. SQL Syntax4. SQL SELECT Statement5. SQL SELECT DISTINCT Statement6. SQL WHERE Clause7. SQL ORDER BY Keyword8. SQL AND Operator9. SQL OR Operator10. SQL NOT Operator11. SQL INSERT INTO Statement12. SQL NULL Values13. SQL UPDATE Statement14. SQL DELETE Statement15. SQL SELECT TOP, LIMIT and FETCH FIRST16. SQL Aggregate Functions17. SQL MIN() F unction18. SQL MAX() Function19. SQL COUNT() Function20. SQL SUM() Function21. SQL AVG() Function22. SQL LIKE Operator23. SQL Wildcards24. SQL IN Operator25. SQL BETWEEN Operator26. SQL Aliases27. SQL Joins28. SQL INNER JOIN29. SQL LEFT JOIN30. SQL RIGHT JOIN31. SQL FULL JOIN32. SQL Self Join33. SQL UNION Operator34. SQL UNION ALL Operator35. SQL GROUP BY Statement36. SQL HAVING Clause37. SQL EXISTS Operator38. SQL ANY Operator39. SQL ALL Operator40. SQL SELECT INTO Statement41. SQL INSERT INTO SELECT Statement42. SQL CASE Expression43. SQL NULL Functions44. SQL Stored Procedures45. SQL Comments46. SQL Operators

On this page

SQL Arithmetic OperatorsSQL Comparison OperatorsSQL Compound OperatorsSQL Bitwise OperatorsSQL Logical Operators