Operator | Operation | Example |
---|---|---|
+ | Addition | x+y |
- | Substraction | x-y |
* | Multiplication | x*y |
/ | Division | x/y |
** | Exponentiation operator | x**y |
DECLARE c_sn calc.sn%type := 1; c_fno calc.fno%type; c_sno calc.sno%type; c_res int; BEGIN SELECT fno, sno INTO c_fno, c_sno FROM calc WHERE sn= c_sn; c_res:=c_fno*c_sno; update calc set res=c_res where sn=c_sn; dbms_output.put_line ('Multiflication of ' ||c_sno || ' * ' || c_sno || ' is = ' || c_res); END; /
Multiflication of 12* 12 is = 24
Operator | Example |
---|---|
= | x=y | < | x<y |
> | x>y |
<= | x<=y |
>= | x>=y |
!= <> ~= |
x!=y x<>y x~=y |
Operator | Description | Example |
---|---|---|
LIKE | The LIKE operator compares a character, string, or CLOB value to a pattern and returns TRUE if the value matches the pattern and FALSE if it does not. | If 'Zara Ali' like 'Z% A_i' returns a Boolean true, whereas, 'Nuha Ali' like 'Z% A_i' returns a Boolean false. |
BETWEEN | The BETWEEN operator tests whether a value lies in a specified range. x BETWEEN a AND b means that x >= a and x <= b. | If x = 10 then, x between 5 and 20 returns true, x between 5 and 10 returns true, but x between 11 and 20 returns false. |
IN | The IN operator tests set membership. x IN (set) means that x is equal to any member of set. | If x = 'm' then, x in ('a', 'b', 'c') returns Boolean false but x in ('m', 'n', 'o') returns Boolean true. |
IS NULL | The IS NULL operator returns the BOOLEAN value TRUE if its operand is NULL or FALSE if it is not NULL. Comparisons involving NULL values always yield NULL. | If x = 'm', then 'x is null' returns Boolean false. |
Operator | Description | Example |
---|---|---|
and | Called the logical AND operator. If both the operands are true then condition becomes true. | (A and B) is false. |
or | Called the logical OR Operator. If any of the two operands is true then condition becomes true. | (A or B) is true. |
not | Called the logical NOT Operator. Used to reverse the logical state of its operand. If a condition is true then Logical NOT operator will make it false. | not (A and B) is true. |