New Delhi, India
minigranth@gmail.com

SQL Operators

Created with Sketch.

SQL Tutorial



[fblike]

SQL Operators : Introduction

  • Being a query language, SQL ultimately generates results for the user by extracting it from the database/tables. Hence, SQL supports the use of operator i.e. SQL operators are used while performing any kind of operation on databases/tables.
  • For this, SQL provides the luxury of four types of operations that can be performed on the database/tables according to the need. These operators are namely :
    • Arithmetic Operators.
    • Bit-wise Operators.
    • Comparison Operators.
    • Logical Operators.

 

SQL Operators : Arithmetic

  • Arithmetic operators are used in SQL to perform basic arithmetic operations including :

 

This image describes the various types of arithmetic operators that can be used as sql operators.

SQL Arithmetic Operator

 

SQL Operators : Comparison

  • Whenever comparison needs to be done, comparison operators can be used. Some of the comparison operators are:

 

This image describes the various comparison operators that can be used in sql.

SQL Comparison Operators

 

SQL Operators : Bit-wise

  • Bit-wise operators are used to perform bit-wise operations(0 & 1) over the expressions which includes :

 

This image describes the various bitwise operators that can be used in sql.

SQL Bitwise Operators

 

SQL Operators : Logical

  • Logical SQL operators are used between queries or used to join two or more conditions or used to extract some specific values. Some of the logical operators are :

 

This image describes the various logical operators that can be used in sql.

SQL Logical Operators

 

  • In case of sub-queries, Operators like “ALL”, “ANY”, “EXISTS” and “SOME” are used.