PL/SQL - Operators
In this chapter, we will discuss operators in PL/SQL. An operator is a symbol that
tells the compiler to perform specific mathematical or logical manipulation. PL/SQL
language is rich in built-in operators and provides the following types of operators −
Arithmetic operators
Relational operators
Comparison operators
Logical operators
String operators
Here, we will understand the arithmetic, relational, comparison and logical operators
one by one. The String operators will be discussed in a later chapter − PL/SQL -
Strings.
Arithmetic Operators
Following table shows all the arithmetic operators supported by PL/SQL. Let us
assume variable A holds 10 and variable B holds 5, then −
Show Examples
Operator Description Example
+ Adds two operands A + B will give 15
- Subtracts second operand from the first A - B will give 5
* Multiplies both operands A * B will give 50
/ Divides numerator by de-numerator A / B will give 2
** Exponentiation operator, raises one operand to the power of other A ** B will give 100000
Relational Operators
Relational operators compare two expressions or values and return a Boolean
result. Following table shows all the relational operators supported by PL/SQL. Let
us assume variable A holds 10 and variable B holds 20, then −
Show Examples
In this chapter, we will discuss operators in PL/SQL. An operator is a symbol that
tells the compiler to perform specific mathematical or logical manipulation. PL/SQL
language is rich in built-in operators and provides the following types of operators −
Arithmetic operators
Relational operators
Comparison operators
Logical operators
String operators
Here, we will understand the arithmetic, relational, comparison and logical operators
one by one. The String operators will be discussed in a later chapter − PL/SQL -
Strings.
Arithmetic Operators
Following table shows all the arithmetic operators supported by PL/SQL. Let us
assume variable A holds 10 and variable B holds 5, then −
Show Examples
Operator Description Example
+ Adds two operands A + B will give 15
- Subtracts second operand from the first A - B will give 5
* Multiplies both operands A * B will give 50
/ Divides numerator by de-numerator A / B will give 2
** Exponentiation operator, raises one operand to the power of other A ** B will give 100000
Relational Operators
Relational operators compare two expressions or values and return a Boolean
result. Following table shows all the relational operators supported by PL/SQL. Let
us assume variable A holds 10 and variable B holds 20, then −
Show Examples