You are on page 1of 2

-->SQL OPERATORS:-(CONTINUED)

-->IS OPERATOR:-

*It is used to comapre with NULL.

SYNTAX:- Col-Name/Exp.. IS NULL;

-->IS NOT OPERATOR:-

*It is simililar to IS operator.


*The selected values gets rejected.

SYNTAX:- Col-Name/Exp.. IS NOT NULL;

-->LIKE OPERATOR:-

*It is used, whenever we have "Pattern_Matching"

SYNTAX:- Col-Name/Exp.. LIKE 'Pattern Matching';

NOTE:-

*Whenever we are using LIKE operator for pattern matching, we need two special
operators.

a) % -->used to find the incomplete name


ex:- S%->Name starts with
%A->Name ends with
%G%->Name contains letter
%LL%->Name contains consecutive letters
%A%A%->Name contains/has two letters
b) _ -->used to find the total number of letters present in a name.
EX:- Name Exactly 4 letters-- ('_ _ _ _')
Salary exactly 3 digits ('_ _ _')

-->NOT LIKE OPERATOR:-

*It is similar to LIKE operator


*The selected values gets rejected.

SYNTAX:- Col-Name/Exp.. NOT LIKE 'Pattern Matching';


-----------------------------------------------------------------------------------
--
-->FUNTIONS:-

*Funtions are block of codes or list of instructions which will perform some
specified/perticular tasks.

-->Types of Functions:-

a)User defined function


b)In-Built/Built-In Function
i) Single row Function/Common Function
ii)Multi row Function/Aggregate/Group Function

i) Single row Function(SRF)/Common Function:-

*If we give single input to the SRF,finally we get single output.


*If we give multiple inputs to the SRF,finally we get Multiple outputs.
*No of inputs is equal to number of outputs.

ex: WAQTD Name & Salary of employees whose salary is 2000.


SELECT ENAME,SAL
FROM EMP
WHERE SAL=2000;

ii)Multi row Function(MRF)/Aggregate/Group Function:-

*If we give single input to the MRF,finally we get single/one output.


*If we give multiple inputs to MRF,Finally we get Single/one Output.
*Number of inputs is equal to single output.

-->Types of MRF:-(5 Types)

1)MAX()
2)MIN()
3)AVG()
4)SUM()
5)COUNT()

1)MAX():-
It is used to obtain Maximum values present in the column.

2)MIN():-
It is used to obtain Minimum values present in the column.

3)AVG(SAL):-
It is used to obtain Average values present in the column.

4)SUM():-
It is used to obtain Total values present in the column.

5)COUNT(*):-
It is used to obtain Number of values present in the column.

-->Characteristics Of MRF:-

*MRF can not accept null values


*Along with MRF,we can not use any other coulumn name inside the select clause.
*We can not use more than one column name inside the function.
*But MRF can accept 'Group by Expression' along with the function
*Where clause can not accept MRF.
*Count() is the only function which will accept astrisks(*) as an arguement.

-----------------------------------------------------------------------------------
------------------

You might also like