0% found this document useful (0 votes)
35 views

Database Management System: Name: Prerna S. Mhatre Class: Sy - Bsc.It

The document discusses different database management system topics such as operators, nested blocks, and labeling blocks. It provides examples of arithmetic, relational, comparison, and logical operators used in databases. Nested blocks allow blocks of code to be contained within other blocks, and labels can be used to name blocks by placing them within angle brackets before the beginning of the block.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Database Management System: Name: Prerna S. Mhatre Class: Sy - Bsc.It

The document discusses different database management system topics such as operators, nested blocks, and labeling blocks. It provides examples of arithmetic, relational, comparison, and logical operators used in databases. Nested blocks allow blocks of code to be contained within other blocks, and labels can be used to name blocks by placing them within angle brackets before the beginning of the block.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

DATABASE

MANAGEMENT SYSTEM
NAME: PRERNA S. MHATRE
CLASS: SY.BSc.IT
TOPICS
01 Operator’s

02 Nested Block

03 Labeling Block
01
Operators

In mathematics and sometimes in computer programming, an


operator is a character that represents an action, as for
example x is an arithmetic operator that represents
multiplication.
Arithmetic Operators:

Arithmetic operators can perform arithmetical operation on numeric


operands involved.
Operator Description Example
Adds values on either side of the
+ (Addition) a + b will give 30
operator.
Subtracts right hand operand
- (Subtraction) a - b will give -10
from left hand operand.
Multiplies values on either side
* (Multiplication) a * b will give 200
of the operator.
Divides left hand operand by
/ (Division) b / a will give 2
right hand operand.
Divides left hand operand by
% (Modulus) right hand operand and returns b % a will give 0
remainder.
Relational Operator:
Relational operators compare two expressions or values and return
a Boolean result. 
Oper Description Example
ator

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

(A >= B) is
Checks if the value of left operand is greater than or not true.
>= equal to the value of right operand, if yes then condition
becomes true.
(A <= B) is
Checks if the value of left operand is less than or equal true
<= to the value of right operand, if yes then condition
becomes true.
Comparison Operator:
Comparison Operators are use to comparing one expression to
another.The result is always True , False or null.

Comparision
Description
Operators

LIKE column value is similar to specified character(s).


column value is equal to any one of a specified set of
IN
values.
column value is between two values, including the end
BETWEEN...AND
values specified in the range.

IS NULL column value does not exist.


Logical Operator:

The Logical operators are those that are true or false. They
return a true or false values to combine one or more true or
false values

Logical Operators Description


For the row to be selected at least one of the conditions
OR
must be true.
For a row to be selected all the specified conditions must be
AND
true.
For a row to be selected the specified condition must be
NOT
false
02
Nested block

In PL/SQL, each block can be nested into another block.


They are referred as a nested block. Nested blocks are
very common when we want to perform the certain
process, and at the same time, the code for these process
should be kept in a separate container (block).
Ex.
DECLARE 
   a number; 
   b number; 
   c number; 
BEGIN 
   a:= 10; 
   b:= 100; 
   IF a > b THEN 
      c:= a; 
   ELSE 
      c:= b; 
   END IF;
   dbms_output.put_line(' Maximum number in 10 and 100: ' || c); 
END; 
03
Labeling the block
A lable can be use to Name a block. Label is placing within << and >>
Just before the beginning of the block.

Syntax:
<<mainblock>>
declare
..
Begin
..
end;
Ex.
<<outerblock>>
DECLARE
counter INTEGER := 0;
BEGIN
...
DECLARE
counter INTEGER := 1;
BEGIN
IF counter = outerblock.counter
THEN ...
END IF;
END;
END;
Thanks
If you have any Questions:
Prerna6080@gmail.com

You might also like