Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
63 views3 pages

Experiment No4

The document summarizes different types of SQL operators: 1) Arithmetic operators are used to perform calculations like addition, subtraction, multiplication, and division. 2) Logical operators like AND, OR, and NOT are used to combine multiple conditions in a WHERE clause. 3) Comparison operators (=, <>, <, >, <=, >=) are used to compare values between operands. 4) Special operators include BETWEEN, IS NULL, ALL, LIKE, IN, and EXISTS, which are used to search for values within a set or compare values to lists. 5) Set operators such as UNION, UNION ALL, MINUS, and INTERSECT are used to combine result sets

Uploaded by

abdur rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views3 pages

Experiment No4

The document summarizes different types of SQL operators: 1) Arithmetic operators are used to perform calculations like addition, subtraction, multiplication, and division. 2) Logical operators like AND, OR, and NOT are used to combine multiple conditions in a WHERE clause. 3) Comparison operators (=, <>, <, >, <=, >=) are used to compare values between operands. 4) Special operators include BETWEEN, IS NULL, ALL, LIKE, IN, and EXISTS, which are used to search for values within a set or compare values to lists. 5) Set operators such as UNION, UNION ALL, MINUS, and INTERSECT are used to combine result sets

Uploaded by

abdur rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment No: 4

Title : Implementation of different types of operators in SQL.


• Arithmetic Operator
• Logical Operator
• Comparison Operator
• Special Operator
• Set Operator

Objective:
• To learn different types of operator.

Theory:
1) ARIHMETIC OPERATORS:

Addition (+) Adds values on either side of the operator


Subtraction (-) Subtracts right hand operand from left
Multiplication (*) Multiplies values on
either side of the operator
Division (/) Divide Left hand operand by right hand operand
power (^) Power- raise to power of
Modulus (%) Divides left hand operand by right hand operand and returns remainder

2) LOGICAL OPERATORS:

AND The AND operator allows the existence of multiple conditions in an SQL statement's
WHERE clause.
OR The OR operator is used to combine multiple conditions in an SQL statement's WHERE
clause
NOT The NOT operator reverses the meaning of the logical operator with which it is used.

3) COMPARISION OPERATORS:

(=) Checks if the values of two operands are equal or not, if yes then condition becomes true.

(!=) Checks if the values of two operands are equal or not, if values are not equal
then condition becomes true.

(< >) Checks if the values of two operands are equal or not, if values are not equal then condition
becomes true
(>) Checks if the value of left operand is less than the value of right operand, if yes
then condition becomes true.

(<) Checks if the value of left operand is less than the value of right operand, if yes then condition
becomes true
(>=) Checks if the value of left operand is greater than or equal to the value of right operand,
if yes then condition becomes true.

(<=) Checks if the value of left operand is less than or equal to the value of right operand, if yes then
condition becomes true.
4) SPECIAL OPERATOR:

BETWEEN The BETWEEN operator is used to search for values that are within a set of
values, given the minimum value and the maximum value.
IS NULL The NULL operator is used to compare a value with a NULL attribute value.
ALL The ALL operator is used to compare a value to all values in another value set
LIKE The LIKE operator is used to compare a value to similar values using wildcard
operators.It allows to use percent sign(%) and underscore ( _ ) to match a given string
pattern.
IN
The IN operator is used to compare a value to a list of literal values that have
been specified.
EXIST The EXISTS operator is used to search for the presence of a row in a specified table
that meets certain criteria.

5) SET OPERATORS:

Union Returns all distinct rows selected by both the queries


Union all Returns all rows selected by either query including the duplicates.

Minus Returns rows selected that are common to both queries.

Intersect Returns all distinct rows selected by the first query and are not by the second

LAB PRACTICE ASSIGNMENT:

• Display all the dept numbers available with the dept and emp tables avoiding
duplicates.
• Display all the dept numbers available with the dept and emp tables.
• Display all the dept numbers available in emp and not in dept tables and vice versa.

************************************

You might also like