SQL Testing
DataBase
DBMS Vs RDBMS
SQL Tutorials
SQL DataTypes
SQL Operators
SQL Statements
DDL (Data Definition Language)
SQL-Create Table
SQL-Alter Table
SQL-Drop Table
SQL-Truncate Table
DML (Data Manipulation Language)
SQL-Select Statement
SQL-Insert Statement
SQL-Update Statement
SQL-Delete Statement
SQL Constraints
SQL-Not Null Constraint
SQL-Unique Constraint
SQL-Primary Key Constraint
SQL-Foreign Key Constraint
SQL-Check Constraint
SQL Special Operators
SQL-IN Operator
SQL-LIKE Operator
SQL-BETWEEN Operator
SQL Sorting (Order By)
SQL Group By
SQL Aggregate Function
SQL Having
SQL Joins
SQL-Cross Join
SQL-Inner Join
SQL-Left Outer Join
SQL-RIGHT Outer Join
SQL-Self Join
SQL SubQueries
ISQL-Independent Sub Queries
SQL-Correlated Sub Queries
SQL Views
SQL Index
SQL Operators | Arithmetic, Comparison
& Logical Operator
SQLÂ operators are used to perform operations like comparisons and arithmetic operations.
there are three types of operators in SQL
Arithmetic operators
SQL Arithmetic operator are the operators which are used for mathematical calculation like addition, subtraction etc.Â
Suppose x= 10 and y =30
Operator |
Description |
Example |
+ |
Addition |
x+y= 40 |
– |
Subtraction |
x-y= -20 |
* |
Multiplication |
x*y=300 |
/ |
Division |
y/x= 3 |
% |
Modulo |
y%x=0 |
Logical operators
Logical operators are the operators which are used for logical operations
Operator |
Description |
ALL |
compare a value to all values in another value set |
AND |
For a row to be selected all the specified conditions must be true |
BETWEEN |
search for values which are within a set of values |
IN |
Allows multiple values in a WHERE clause. |
LIKE |
used to compare a value to similar values using wildcard operators. |
NOT |
For a row to be selected all the specified conditions must be false |
OR |
For a row to be selected at least one of the conditions must be true |
EXISTS |
Condition is met if subquery returns at least one row |
Relational Operators
Relational Operators are used to compare the values of two columns in SQL statements.
Operator |
Description |
= |
Equal |
<= |
Less Than or Equal |
>= |
Greater Than or Equal |
<> or != |
Not Equal |
<Â |
Less Than |
>Â |
Greater Than |
Recommended Articles:
SQL Testing
DataBase
DBMS Vs RDBMS
SQL Tutorials
SQL DataTypes
SQL Operators
SQL Statements
DDL (Data Definition Language)
SQL-Create Table
SQL-Alter Table
SQL-Drop Table
SQL-Truncate Table
DML (Data Manipulation Language)
SQL-Select Statement
SQL-Insert Statement
SQL-Update Statement
SQL-Delete Statement
SQL Constraints
SQL-Not Null Constraint
SQL-Unique Constraint
SQL-Primary Key Constraint
SQL-Foreign Key Constraint
SQL-Check Constraint
SQL Special Operators
SQL-IN Operator
SQL-LIKE Operator
SQL-BETWEEN Operator
SQL Sorting (Order By)
SQL Group By
SQL Aggregate Function
SQL Having
SQL Joins
SQL-Cross Join
SQL-Inner Join
SQL-Left Outer Join
SQL-RIGHT Outer Join
SQL-Self Join
SQL SubQueries
ISQL-Independent Sub Queries
SQL-Correlated Sub Queries
SQL Views
SQL Index