Q 15. What are the different operators available in SQL?
Ans: Generally, there are three types of operators that are used in SQL.
1. Arithmetic Operators
2. Comparison Operators
3. Logical Operators
➢ Arithmetic SQL Operators
Arithmetic operators are used to perform arithmetic operations such as addition, subtraction, division, and multiplication. These operators usually accept numeric operands.
➢ Comparison SQL Operators
Comparison operators in SQL are used to check the equality of two expressions. It checks whether one expression is identical to another.
Comparison operators are generally used in the WHERE clause of a SQL query.
The result of a comparison operation may be TRUE, FALSE or UNKNOWN.
When one or both the expression is NULL, then the operator returns UNKNOWN. These operators could be used on all types of expressions except expressions that contain a text, ntext or an image.
➢ Logical SQL Operators
Logical operators are those operators that take two expressions as operands and return TRUE or False as output. While working with complex SQL statements and queries, comparison operators come in handy and these operators work in the same way as logic gates do.
No comments:
Post a Comment