0% found this document useful (0 votes)
15 views1 page

After Mte

The document contains multiple PL/SQL code blocks that declare variables, perform basic math operations and comparisons, insert and select data from tables, and conditionally output values. Variables are declared as numbers and used in addition, and values are inserted into and selected from a table to update a total field.

Uploaded by

Varun Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

After Mte

The document contains multiple PL/SQL code blocks that declare variables, perform basic math operations and comparisons, insert and select data from tables, and conditionally output values. Variables are declared as numbers and used in addition, and values are inserted into and selected from a table to update a total field.

Uploaded by

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

declare

a number(2);
b number(2);
c number(2);
begin
a:=5;
b:=-2;
c:=a+b;
dbms_output.put_line('sum='||c);
end;

declare
a number(2);
b number(2);
c number(2);
begin
a:=5;
b:=-2;
c:=a+b;
dbms_output.put_line('sum='||c);
end;

create table emp_data(Emp_name varchar(4),Empid int,TA int,DA int,total


int,Branch_city varchar(10));
insert into emp_data values('abc',1,1200,1345,2545,'Delhi');
insert into emp_data values('xyz',2,1100,1200,2300,'Mumbai');
select *from emp_data;

declare
a number(5);
b number(5);
t number(5);
Begin
select ta,da into a,b from emp_data where empid=1;
t:=a+b;
update emp_data set total=t where empid=1;
end;
select *from emp_data;

declare
num1 number(5);
num2 number(5);
Begin
num1 := :num1;
num2 := :num2;
if num1>num2 then
dbms_output.put_line('greater number is ='|| num1);
else
dbms_output.put_line('greater number is ='|| num2);
end if;
end;

You might also like