Sql arithmetic operators

SQL is widely used by RDBMs, TO  perform common database operations, such as querying, iserting, updatiing and deletiing data. These operations are performed by using SQL Operaors. An operator is a symbol that reprasents an acion, which is performed on one or more expressions to produce the desired results. In sql there are various types of operators, such as value, logical, and query expression operators. These operators also help you to perform a number of functions, such as numeric functions, date functions, character functions, and row functions.

SQL Arithmetic Operators :  Arithmetic operators are used to perform different arithmetic operations, such as addition and subtraction.

Arithmetoc operator Description
+,  - Provide sign for a number expression.
*./ Allow multiply and divide values
+,- Alloow you to add and subtract values

SQL Logical Operators : SQL lOGICAL operators are use to combine Boolean conditions given in the where clause. In othr words, logical operators are used to  test a specific condition.The logical operators returnns  either true or flse.

Logical Operator Description
AND Combine two logical conditions; it returns true if both conditions are True.
OR Combine two logical conditions; it returns true if any one of the logical condition is true. 
NOT Reverse thhe result of a logical expression

 SQL Query Expression Operators : Query Expression operators are used to combine the results of multiple queries.

Query expression operator Description
UNION Returns all distinct rows from different queries.
INTERSECT rETURNS ALL DISTINCT ROWS RETURN BY ALL QUERIES INDIVIDUALLY. A row is returned if it appears in the result of each query.
Minus Returns all distinct rows returned by the first query,but not second query

Number Functions :

The number functions are used with numeric data. They take a number as an argument. These functions are provided to implement processing that is otherwise no possible with other SQL clauses.

Function Description
ABS(n) Provide absolute value of n . example: ABS(-9) = 9
CEIL(n) Gives smallest integer greater than or equal to n . example; CEIL(9.5) = 10
FLOOR(n) Gives largest integer less than or equal to n . example: FLOOR(10.5)=10
MOD(m,n) Gives remainder, after dividiing m by n
POWER(m,n) Returns the value of specified expression (m) raised to the power n,, where n is integer
ROUND(n,m) Rounds n to m decimal places
TRUNC(n,m) Truncates n to m decimal places
SIGN(n) Returns -1 if n<0; if n>0; 0 if n=0
SQRT(n) Gives square root of n